paste values in blank cell

M

Mayte

I want to add some data from tab B to tab A. I was to past the values on tab
B below the last row on tab A. the problem is that when i do my macro I
can't figure out how to select the last emply cell in colum b. the way i have
it now, it's pasting values as of B7 and I want it below b7 or whatever is
the last empty cell in column b ...make sense? any ideas?

Sub ADD_to_Month()
'
' ADD_to_Month Macro
' Macro recorded 6/2/2008 by Mayte
'

'
Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Tab A").Select
Selection.End(xlDown).Select
Range("B7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
End Sub
 
D

Don Guillett

Notice the placement of the dots in the WITH statement. Fire from source
sheet

Sub copyvaluetoothersheet()
With Sheets("yourdestinationsheetnamehere")
lr = .Cells(Rows.Count, "a").End(xlUp).Row + 1
.Cells(lr, 1).Value = _
Range("c2").End(xlDown).End(xlToRight).Value
End With
End Sub
 
D

Don Guillett

IF?? you are in TabB at the time and you have data as described then this
will work. I have modified to suit your post.

Sub copyvaluetoothersheet()
With Sheets("Tab A")
lr = .Cells(Rows.Count, "b").End(xlUp).Row + 1
.Cells(lr, "b").Value = _
Range("c2").End(xlDown).End(xlToRight).Value
End With
End Sub
 
M

Mayte

thanks ....

it works but it put a number "1" below cell in column b of tab A ..how do i
get all data from tab B into A?
 
D

Don Guillett

Is this what you want to copy the range instead of just the last cell?

Sub ci2()
With Sheets("Tab A")
lr = .Cells(Rows.Count, "b").End(xlUp).Row + 1
Range("c2", Range("c2").End(xlDown).End(xlToRight)).Copy
..Cells(lr, "b").PasteSpecial Paste:=xlValues
End With
End Sub
 

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