Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data
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") -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "RB" wrote in message ... 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data
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 -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "RB" wrote in message ... 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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data
To help in your assignment look in the archives for last row -- Don Guillett Microsoft MVP Excel SalesAid Software "RB" wrote in message ... 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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data
Try this
Sub cop() Range("A1", Range("A1").End(xlDown)).Copy _ Destination:=Worksheets("Sheet1").Range("A1") Application.CutCopyMode = False End Sub |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data
Thanks Ron,
That solved my problem! "Ron de Bruin" wrote: 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") -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "RB" wrote in message ... 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. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data
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 -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "RB" wrote in message ... Thanks Ron, That solved my problem! "Ron de Bruin" wrote: 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") -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "RB" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying rows of data into new worksheet but placing data into colu | Excel Discussion (Misc queries) | |||
Comparing data between sheets, and copying rows with data | Excel Programming | |||
Copying data as static as source data changes | Excel Worksheet Functions | |||
Copying Data into Column with Existing Data | Excel Discussion (Misc queries) | |||
Copying data down to next dirty cell, then copying that data | Excel Programming |