I have a piece of code that I am using to find the first blank cell in a
range. I want to be able to then go over a specific number of columns from
that blank cell to paste a formula in it. Is there a macro that I can use to
do that?
I have a piece of code that I am using to find the first blank cell in a
range. I want to be able to then go over a specific number of columns from
that blank cell to paste a formula in it. Is there a macro that I can use to
do that?
Without any code posted I will just assume that you are using the active
cell. If that is the case then
Activecell.offset(0, 2) 'two columns to the right...
if you are using range objects then you can just offset your range object in
a similar manner with a set statement...
--
HTH...
Jim Thomlinson
"Kurt Barr" wrote:
> I have a piece of code that I am using to find the first blank cell in a
> range. I want to be able to then go over a specific number of columns from
> that blank cell to paste a formula in it. Is there a macro that I can use to
> do that?
You can use the Offset property of the Range object. E.g.,
Dim Rng As Range
Dim Rng2 As Range
Set Rng = Range("A1") ' or whatever
Set Rng2 = Rng.Offset(0,3) ' 3 cols to the right
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Kurt Barr" <Kurt [email protected]> wrote in
message
news:[email protected]...
>I have a piece of code that I am using to find the first blank
>cell in a
> range. I want to be able to then go over a specific number of
> columns from
> that blank cell to paste a formula in it. Is there a macro that
> I can use to
> do that?
That worked perfectly. Thank you very much!
"Jim Thomlinson" wrote:
> Without any code posted I will just assume that you are using the active
> cell. If that is the case then
>
> Activecell.offset(0, 2) 'two columns to the right...
>
> if you are using range objects then you can just offset your range object in
> a similar manner with a set statement...
> --
> HTH...
>
> Jim Thomlinson
>
>
> "Kurt Barr" wrote:
>
> > I have a piece of code that I am using to find the first blank cell in a
> > range. I want to be able to then go over a specific number of columns from
> > that blank cell to paste a formula in it. Is there a macro that I can use to
> > do that?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks