Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
have a macro recognize added rows
I have written a macro to change the cell format over several speciffic
ranges. Two if the ranges are meant to be flexible by added rows. The macro as an absolute value default does not recognize the added rows and as a result the format changes in the wrong area. Is there a work around here? A way to have the macro flex when the rows are added? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
have a macro recognize added rows
The following code will give you the last populated row in Column A on
sheet1. Knowing that you should be able to get your range sorted out. Your range to format can alse be defined strictly using range objects whish would probably be more efficient but it also requires a greater understanding... dim lngLastRow as long lnglastrow = worksheets("Sheet1").Cells(rows.count, "A").End(xlUp).row msgbox lngLastRow -- HTH... Jim Thomlinson "Mike M." wrote: I have written a macro to change the cell format over several speciffic ranges. Two if the ranges are meant to be flexible by added rows. The macro as an absolute value default does not recognize the added rows and as a result the format changes in the wrong area. Is there a work around here? A way to have the macro flex when the rows are added? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
have a macro recognize added rows
You could use a named range. Rows inserted into a named range expand the range... Range("FlexRange").Interior.ColorIndex = 40 -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Mike M." <Mike wrote in message I have written a macro to change the cell format over several speciffic ranges. Two if the ranges are meant to be flexible by added rows. The macro as an absolute value default does not recognize the added rows and as a result the format changes in the wrong area. Is there a work around here? A way to have the macro flex when the rows are added? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
have a macro recognize added rows
For that Mike you may want to use a dynamic named range...
http://www.cpearson.com/excel/named.htm -- HTH... Jim Thomlinson "Jim Cone" wrote: You could use a named range. Rows inserted into a named range expand the range... Range("FlexRange").Interior.ColorIndex = 40 -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Mike M." <Mike wrote in message I have written a macro to change the cell format over several speciffic ranges. Two if the ranges are meant to be flexible by added rows. The macro as an absolute value default does not recognize the added rows and as a result the format changes in the wrong area. Is there a work around here? A way to have the macro flex when the rows are added? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sum to recognize new rows | Excel Discussion (Misc queries) | |||
run a macro which looks at ranges with added rows | New Users to Excel | |||
Pivot Table Wizard Fails to Recognize New Rows of a Named Range | Excel Worksheet Functions | |||
Pivot Table Wizard Fails to Recognize New Rows of Database | Excel Discussion (Misc queries) | |||
Adding 4 rows after each total criteria in the column A with formatting and added text using macro. | Excel Programming |