Absolute to Relative

G

Guest

The macro below returns a forumula that has an address that is absolute. How
would I force the macro to return an address that is relative (without the
dollar signs)?

ActiveCell.Formula = "=" & ActiveCell.Offset(0, -1).Address & "-4"
 
B

Bob Phillips

ActiveCell.Formula = "=" & ActiveCell.Offset(0, -1).Address(false,false) &
"-4"


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
D

Dave Peterson

ActiveCell.Formula = "=" & ActiveCell.Offset(0, -1).Address(0,0) & "-4"

Put your cursor on the word .Address (when you're in the VBE) and hit F1.

You'll see a couple of options for rowabsolute and columnabsolute.

(0,0) is the same as (false,false)
which is the same as: (rowabsolute:=false,columnabsolute:=false)
 
G

Guest

Thanks!
--
l-hawk


Dave Peterson said:
ActiveCell.Formula = "=" & ActiveCell.Offset(0, -1).Address(0,0) & "-4"

Put your cursor on the word .Address (when you're in the VBE) and hit F1.

You'll see a couple of options for rowabsolute and columnabsolute.

(0,0) is the same as (false,false)
which is the same as: (rowabsolute:=false,columnabsolute:=false)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top