Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I dynamically change the range for Range("A1:M500")?
I initially clear the following Range("A1:M500") in one of my worksheets.
Using VB, I add data to this worksheet so only 10-20 rows have data. How do I change my range dynamically based on the number of rows with data and columns with data? Reason I want to do this is because I want to set my print area in VB. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I dynamically change the range for Range("A1:M500")?
ActiveSheet.PageSetup.PrintArea = Range("A1").CurrentRegion
"Bij" wrote: I initially clear the following Range("A1:M500") in one of my worksheets. Using VB, I add data to this worksheet so only 10-20 rows have data. How do I change my range dynamically based on the number of rows with data and columns with data? Reason I want to do this is because I want to set my print area in VB. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I dynamically change the range for Range("A1:M500")?
Sorry, NOT working. Have to try harder.
"PY & Associates" wrote: ActiveSheet.PageSetup.PrintArea = Range("A1").CurrentRegion "Bij" wrote: I initially clear the following Range("A1:M500") in one of my worksheets. Using VB, I add data to this worksheet so only 10-20 rows have data. How do I change my range dynamically based on the number of rows with data and columns with data? Reason I want to do this is because I want to set my print area in VB. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I dynamically change the range for Range("A1:M500")?
You nearly had it:
ActiveSheet.PageSetup.PrintArea = Range("A1").CurrentRegion.Address Regards Rowan "PY & Associates" wrote: Sorry, NOT working. Have to try harder. "PY & Associates" wrote: ActiveSheet.PageSetup.PrintArea = Range("A1").CurrentRegion "Bij" wrote: I initially clear the following Range("A1:M500") in one of my worksheets. Using VB, I add data to this worksheet so only 10-20 rows have data. How do I change my range dynamically based on the number of rows with data and columns with data? Reason I want to do this is because I want to set my print area in VB. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
please change Range("AB30").Select to any cell | Excel Worksheet Functions | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
Array as a "named range" - formula ok in cells, but error as "named range" | Excel Discussion (Misc queries) | |||
"deselect ?" a range or change state from edit to ? | Excel Programming |