Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Row - 1 in vba
I have a Name define Row B104:O104 as [Last], but I would like it to take 1
row before [Last]. something like - 1. so if [Last] is B104:O104 i want B103:O103 to be the row selected. code in VBA Right now I have Range("B31:O31", [Last]) I wnat it to be Range("B31:O31", [Last]-1) or something. I tried [Last].Row-1 but did not work. got an error when i ran it. Thank You |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Row - 1 in vba
Range("B31:O31", Range("Last").Offset(-1, 0))
-- HTH... Jim Thomlinson "Damian" wrote: I have a Name define Row B104:O104 as [Last], but I would like it to take 1 row before [Last]. something like - 1. so if [Last] is B104:O104 i want B103:O103 to be the row selected. code in VBA Right now I have Range("B31:O31", [Last]) I wnat it to be Range("B31:O31", [Last]-1) or something. I tried [Last].Row-1 but did not work. got an error when i ran it. Thank You |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Row - 1 in vba
Range("B31:O31").Resize(Range("Last").Row-Range("B31:O31").row)
Range("B31:O31").Resize(Range("Last").Row-Range("B31:O31").row).Select If this post helps click Yes --------------- Jacob Skaria "Damian" wrote: I have a Name define Row B104:O104 as [Last], but I would like it to take 1 row before [Last]. something like - 1. so if [Last] is B104:O104 i want B103:O103 to be the row selected. code in VBA Right now I have Range("B31:O31", [Last]) I wnat it to be Range("B31:O31", [Last]-1) or something. I tried [Last].Row-1 but did not work. got an error when i ran it. Thank You |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|