Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am using a macro to drop numbers into cells D2:F2 these numbers are changing so the macro I require is to place D2:F2 data into cells A2:C2 the challenge i have is once cells A2:C2 are no longer blank how can run a macro to place the next data from D2:F2 to blank cells A3:C3 then A4:C4 etc Cells D2:F2 will always be constant cells with data changing when invoking the macro. Thankyou for looking at this for me Kind Regards Darrel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this macro a try...
Sub CopyD2F2() Dim Lastrow As Long With Worksheets("Sheet8") Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("D2:F2").Copy .Cells(Lastrow + 1, "A") End With End Sub The above macro assumes, since you are starting in Row 2, that A1 contains some text (the header for the column). If A1 will be blank, then the macro will need to be adjusted. -- Rick (MVP - Excel) "Daz" wrote in message ... Hello, I am using a macro to drop numbers into cells D2:F2 these numbers are changing so the macro I require is to place D2:F2 data into cells A2:C2 the challenge i have is once cells A2:C2 are no longer blank how can run a macro to place the next data from D2:F2 to blank cells A3:C3 then A4:C4 etc Cells D2:F2 will always be constant cells with data changing when invoking the macro. Thankyou for looking at this for me Kind Regards Darrel |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Rick Rothstein" wrote: Give this macro a try... Sub CopyD2F2() Dim Lastrow As Long With Worksheets("Sheet8") Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("D2:F2").Copy .Cells(Lastrow + 1, "A") End With End Sub The above macro assumes, since you are starting in Row 2, that A1 contains some text (the header for the column). If A1 will be blank, then the macro will need to be adjusted. -- Rick (MVP - Excel) "Daz" wrote in message ... Hello, I am using a macro to drop numbers into cells D2:F2 these numbers are changing so the macro I require is to place D2:F2 data into cells A2:C2 the challenge i have is once cells A2:C2 are no longer blank how can run a macro to place the next data from D2:F2 to blank cells A3:C3 then A4:C4 etc Cells D2:F2 will always be constant cells with data changing when invoking the macro. Thankyou for looking at this for me Kind Regards Darrel |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Rick Rothstein" wrote: Give this macro a try... Sub CopyD2F2() Dim Lastrow As Long With Worksheets("Sheet8") Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("D2:F2").Copy .Cells(Lastrow + 1, "A") End With End Sub The above macro assumes, since you are starting in Row 2, that A1 contains some text (the header for the column). If A1 will be blank, then the macro will need to be adjusted. -- Rick (MVP - Excel) "Daz" wrote in message ... Hello, I am using a macro to drop numbers into cells D2:F2 these numbers are changing so the macro I require is to place D2:F2 data into cells A2:C2 the challenge i have is once cells A2:C2 are no longer blank how can run a macro to place the next data from D2:F2 to blank cells A3:C3 then A4:C4 etc Cells D2:F2 will always be constant cells with data changing when invoking the macro. Thankyou for looking at this for me Kind Regards Darrel Thankyou Mr Rothstein, the macro works perfectly and will save me a large amount of time, Thankyou again Kind Regards Daz |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to copy & paste data | Excel Discussion (Misc queries) | |||
Copy/Paste Macro using large amount of Data | Excel Discussion (Misc queries) | |||
1 Create a macro to Copy & paste certain data to another sheet | Excel Discussion (Misc queries) | |||
create a macro to copy/paste cell data | Excel Programming | |||
macro to copy paste non empty data | Excel Programming |