Copying data

  • Thread starter Thread starter RB
  • Start date Start date
R

RB

Hi All,

I want to copy data from one sheet to another. I have to select Col A and
as many rows that have data in it (from A1 to A32), but this has to be
dynamic becuase the rows might change. I then have to copy these selected
cells to sheet 1. I nedd the code for this. I knw the solution is simple but
cajt seem to figure out. Can somebody pls help. It will be appreciated.
 
Try this to copy from Sheet1 to sheet2 A1

Sheets("Sheet1").Range("A1:A" & Range( _
"A" & Rows.Count).End(xlUp).Row).Copy Sheets("Sheet2").Range("A1")
 
This one is better

Sub test()
With Sheets("Sheet1")
.Range("A1:A" & .Range( _
"A" & .Rows.Count).End(xlUp).Row).Copy Sheets("Sheet2").Range("A1")
End With
End Sub
 
Try this

Sub cop()
Range("A1", Range("A1").End(xlDown)).Copy _
Destination:=Worksheets("Sheet1").Range("A1")
Application.CutCopyMode = False
End Sub
 
Thanks Ron,

That solved my problem!

Ron de Bruin said:
Try this to copy from Sheet1 to sheet2 A1

Sheets("Sheet1").Range("A1:A" & Range( _
"A" & Rows.Count).End(xlUp).Row).Copy Sheets("Sheet2").Range("A1")
 
Hi RB

You are welcome

Use the other example I posted, this one is also working correct if "sheet1" is not active.


Sub test()
With Sheets("Sheet1")
.Range("A1:A" & .Range( _
"A" & .Rows.Count).End(xlUp).Row).Copy Sheets("Sheet2").Range("A1")
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

Back
Top