Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to grab a reference into VB
I have a macro that publishes a sheet as a webpage in the range "$A$1:$K$56"
but I'd like to change it to "$A$1:$K$**" instead where the ** number is pulled from a cell, say P1 based on the result of a formula in P1 because I have to manually change the macro every time the number of rows changes. Is that possible? Thanks, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to grab a reference into VB
you should be able to use:
Range("A1:K" & Range("P1").Value) assuming you are working with the activesheet. otherwise qualify the range references with the proper worksheet references. "sb1920alk" wrote: I have a macro that publishes a sheet as a webpage in the range "$A$1:$K$56" but I'd like to change it to "$A$1:$K$**" instead where the ** number is pulled from a cell, say P1 based on the result of a formula in P1 because I have to manually change the macro every time the number of rows changes. Is that possible? Thanks, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to grab a reference into VB
"A1:K" & Range("P1").Value is what worked, I kept getting an error with
Range("A1:K" & Range("P1").Value) Thanks for pointing me in the right direction. "JMB" wrote: you should be able to use: Range("A1:K" & Range("P1").Value) assuming you are working with the activesheet. otherwise qualify the range references with the proper worksheet references. "sb1920alk" wrote: I have a macro that publishes a sheet as a webpage in the range "$A$1:$K$56" but I'd like to change it to "$A$1:$K$**" instead where the ** number is pulled from a cell, say P1 based on the result of a formula in P1 because I have to manually change the macro every time the number of rows changes. Is that possible? Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
number grab | New Users to Excel | |||
grab detail when = 1 | Excel Worksheet Functions | |||
Numeric reference of column. Data Grab ? | Excel Discussion (Misc queries) | |||
Grab name of folder | Excel Programming | |||
Grab Password Name | Excel Programming |