Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi could somebody please give me the correct code for the following.
LastRow = Cells(Application.Rows.Count, 1).End(xlUp).Row Rows(LastRow + 2).NumberFormat = "0.00" I need to format from LastRow + 2 more rows with "0.00" What i have got formats the second row after the last row ? thanks in advance Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim LastRow as long
with activesheet lastrow = .cells(.rows.count,1).end(xlup).row .rows(lastrow +1).resize(2).numberformat = "0.00" end with I'm kind of confused about what you want formatted. Do you mean the lastrow plus the next? Or do you mean the two after the lastrow? the +1 says to come down one row, but then format the next two. .resize(2) says to make that original range .rows(lastrow+1) two rows deep.) Les Stout wrote: Hi could somebody please give me the correct code for the following. LastRow = Cells(Application.Rows.Count, 1).End(xlUp).Row Rows(LastRow + 2).NumberFormat = "0.00" I need to format from LastRow + 2 more rows with "0.00" What i have got formats the second row after the last row ? thanks in advance Les Stout *** Sent via Developersdex http://www.developersdex.com *** -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Dave, i need to format the last row and the next 3 rows.
Thanks for the help. Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't add +1
and resize to include 4 rows... dim LastRow as long with activesheet lastrow = .cells(.rows.count,1).end(xlup).row .rows(lastrow).resize(4).numberformat = "0.00" end with Les Stout wrote: Hi Dave, i need to format the last row and the next 3 rows. Thanks for the help. Les Stout *** Sent via Developersdex http://www.developersdex.com *** -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Dave, had figured it out in the meantime.
great weekend !! Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select multiple rows and format | Excel Discussion (Misc queries) | |||
How can i randomly select 780 rows from 4000 rows of data | Excel Worksheet Functions | |||
select block of rows w/data between blank rows | Excel Programming | |||
Unable to select rows in the repeat rows on top option | Excel Discussion (Misc queries) | |||
When I select "format cells", the format dialog box does not disp. | Excel Worksheet Functions |