Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
daz daz is offline
external usenet poster
 
Posts: 8
Default Copy and paste data using macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Copy and paste data using macro

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   Report Post  
Posted to microsoft.public.excel.programming
daz daz is offline
external usenet poster
 
Posts: 8
Default Copy and paste data using macro



"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   Report Post  
Posted to microsoft.public.excel.programming
daz daz is offline
external usenet poster
 
Posts: 8
Default Copy and paste data using macro



"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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy & paste data Satish Excel Discussion (Misc queries) 3 December 18th 08 04:50 AM
Copy/Paste Macro using large amount of Data Nikki Excel Discussion (Misc queries) 2 December 10th 08 03:12 PM
1 Create a macro to Copy & paste certain data to another sheet Lin1981 Excel Discussion (Misc queries) 1 November 6th 08 11:56 PM
create a macro to copy/paste cell data joshua.v Excel Programming 1 September 14th 04 04:42 PM
macro to copy paste non empty data paritoshmehta[_22_] Excel Programming 0 July 1st 04 09:17 PM


All times are GMT +1. The time now is 01:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"