Macro newbie

G

Guest

Hi folks-

I have two sheets in my workbook: Data and Table. I would like to compile a
table based on my 5-cell range (A1:E1) in my Data sheet. However, I need
this data to appear in the next available cell in Column B on my Table sheet.
I've tried looking at previous responses to this similar question and have
failed miserably in an attempt to try to work this properly. Here is what I
have thus far:

Sub test1()

Sheets("Data").Select
Range("A1:E1").Select
Selection.Copy
Sheets("Table").Select
Range("B10").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub

Thank you for sharing your VB knowledge with me.
Sincerely,
Joe
(e-mail address removed)
 
J

Jack Schitt

VB Newbie said:
Hi folks-

I have two sheets in my workbook: Data and Table. I would like to compile
a
table based on my 5-cell range (A1:E1) in my Data sheet. However, I need
this data to appear in the next available cell in Column B on my Table
sheet.
I've tried looking at previous responses to this similar question and have
failed miserably in an attempt to try to work this properly. Here is what
I
have thus far:

Sub test1()

Sheets("Data").Select
Range("A1:E1").Select
Selection.Copy
Sheets("Table").Select
Range("B10").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
End Sub

Thank you for sharing your VB knowledge with me.
Sincerely,
Joe
(e-mail address removed)

A couple of possibilities:

Option Explicit

Sub MyCopy1()
Dim rCell As Range
With Application
With .ThisWorkbook
Set rCell = .Worksheets("Table").Range("B65536").End(xlUp).Offset(1, 0)
..Worksheets("Data").Range("A1:E1").Copy
rCell.PasteSpecial Paste:=xlValues
End With '.Thisworkbook
..CutCopyMode = False
End With 'Application
End Sub 'MyCopy1()

Sub MyCopy2()
Dim rCell As Range
Dim rSource As Range
With Application.ThisWorkbook
Set rCell = .Worksheets("Table").Range("B65536").End(xlUp).Offset(1,
0).Resize(1, 5)
rCell.Value = .Worksheets("Data").Range("A1:E1").Value
End With 'Application.ThisWorkbook
End Sub 'MyCopy2()
 
S

Sharad Naik

What to you mean by next available cell in Column B?
Do you mean the first available empty cell in coloumn B?

Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top