ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offset (https://www.excelbanter.com/excel-programming/382494-re-offset.html)

DavidM

Offset
 
Hi guys sorry I made a blob I apologize

The T should have been AG

I'm wanting it to paste the Content of AH2 to "AH3 to AH10"
which is to the right of any data cells in column AG, until it finds a blank
cell in column AG then stops pasting to cells in column AH.


AG1 has header
AG2 to AG10 has data in cells

AH1 has header
AH2 data
AH3 to AH10 Blank

Thanks for your reply

DaveM



Tom Ogilvy

Offset
 
Sub AAA()
Range("AH1").End(xlDown).Select
Selection.Copy ActiveCell.Offset(1, 0)
ActiveCell.Offset(1, 0).Select
Do
ActiveCell.Copy _
ActiveCell.Offset(1, 0)
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(Cells(ActiveCell.Row, "AG"))
ActiveCell.ClearContents
End Sub

--
Regards,
Tom Ogilvy


"DavidM" wrote:

Hi guys sorry I made a blob I apologize

The T should have been AG

I'm wanting it to paste the Content of AH2 to "AH3 to AH10"
which is to the right of any data cells in column AG, until it finds a blank
cell in column AG then stops pasting to cells in column AH.


AG1 has header
AG2 to AG10 has data in cells

AH1 has header
AH2 data
AH3 to AH10 Blank

Thanks for your reply

DaveM





All times are GMT +1. The time now is 08:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com