ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy row formatting down (https://www.excelbanter.com/excel-programming/383577-copy-row-formatting-down.html)

CLR

Copy row formatting down
 
Hi All.....
If someone would be so kind......I need help. I'm trying to copy the
formatting, (including Conditional formatting), from Range A11:AG11, down the
sheet, as far as there is data in column A.....the recorder is not too good
at this, and I'm even worse.

TIA
Vaya con Dios,
Chuck, CABGx3



Rob Edwards

Copy row formatting down
 
When you don't know the end point of a range, then select a point you do
know (i.e. "A1") then use End(xlDown) & any offsets as necessary. Foe
example...

Range("A1").Select: Range(ActiveCell, ActiveCell.End(xlDown).Offset(x,
y)).Select

Substitute x & y with values if necessary, or just remove the Offset.

Rob Edwards

Always look on the bright side of life!

*** Sent via Developersdex http://www.developersdex.com ***

Tom Ogilvy

Copy row formatting down
 
Dim lastrow as Long
lastrow = Cells(rows.count,"A").end(xlup).row
Range("A11:AG11").copy
Range(cells(12,"A"),cells(lastrow,"AG")).PasteSpec ial _
xlFormats

--
Regards,
Tom Ogilvy


"CLR" wrote:

Hi All.....
If someone would be so kind......I need help. I'm trying to copy the
formatting, (including Conditional formatting), from Range A11:AG11, down the
sheet, as far as there is data in column A.....the recorder is not too good
at this, and I'm even worse.

TIA
Vaya con Dios,
Chuck, CABGx3



Dave Peterson

Copy row formatting down
 
Untested:

Dim LastRow as long
with worksheets("sheet9999")
lastrow = .cells(.rows.count,"A").end(xlup).row
.range("a11:AG11").copy
.range("a11:A" & lastrow).pastespecial paste:=xlpasteformats
end with

CLR wrote:

Hi All.....
If someone would be so kind......I need help. I'm trying to copy the
formatting, (including Conditional formatting), from Range A11:AG11, down the
sheet, as far as there is data in column A.....the recorder is not too good
at this, and I'm even worse.

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson

CLR

Copy row formatting down
 
Thanks much Tom.........that did exactly as I needed.

Vaya con Dios,
Chuck, CABGx3



"Tom Ogilvy" wrote:

Dim lastrow as Long
lastrow = Cells(rows.count,"A").end(xlup).row
Range("A11:AG11").copy
Range(cells(12,"A"),cells(lastrow,"AG")).PasteSpec ial _
xlFormats

--
Regards,
Tom Ogilvy


"CLR" wrote:

Hi All.....
If someone would be so kind......I need help. I'm trying to copy the
formatting, (including Conditional formatting), from Range A11:AG11, down the
sheet, as far as there is data in column A.....the recorder is not too good
at this, and I'm even worse.

TIA
Vaya con Dios,
Chuck, CABGx3



CLR

Copy row formatting down
 
Thanks for the response Rob.....it looks understandable, and when I get more
time, I'll study it...........for now, Tom hit the nail on the head.

Thanks
Vaya con Dios,
Chuck, CABGx3



"Rob Edwards" wrote:

When you don't know the end point of a range, then select a point you do
know (i.e. "A1") then use End(xlDown) & any offsets as necessary. Foe
example...

Range("A1").Select: Range(ActiveCell, ActiveCell.End(xlDown).Offset(x,
y)).Select

Substitute x & y with values if necessary, or just remove the Offset.

Rob Edwards

Always look on the bright side of life!

*** Sent via Developersdex http://www.developersdex.com ***


CLR

Copy row formatting down
 
Thanks Dave......Tom already got me there. Yours looks good too, but in this
case I'm using this in a sub that is called to many different sheets, so I'd
like to keep the sheet reference out of it.

Thanks anyway,
Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote:

Untested:

Dim LastRow as long
with worksheets("sheet9999")
lastrow = .cells(.rows.count,"A").end(xlup).row
.range("a11:AG11").copy
.range("a11:A" & lastrow).pastespecial paste:=xlpasteformats
end with

CLR wrote:

Hi All.....
If someone would be so kind......I need help. I'm trying to copy the
formatting, (including Conditional formatting), from Range A11:AG11, down the
sheet, as far as there is data in column A.....the recorder is not too good
at this, and I'm even worse.

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson



All times are GMT +1. The time now is 08:12 PM.

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