D
Dkso
Hi,
I need a Macro button, to put a formula into a cell. This Cell will
always be 1(ONE) Cell above a users id but can be in different places
so it must be a macro.
The formula is used to perform a Lookup on the Cell below into a Range
held in a different spreadsheet.
What I have is below and it works EXCEPT the formula that is put into
each Cell has the word "Address" in it and not the actual referance
for the Cell
Is there a way to have this changed to the Cell Referance that I need
or is there a simpler way of doing it (probably knowing me)!
Thanks for any help provided....
Dean
VBA coding
Sub UserName()
ActiveCell.FormulaR1C1 = ActiveCell.Address ******Get ActiveCell
Referance
a = Right(ActiveCell.Address, 1)******Split off Right charater
a = a + 1*Add 1
Add = Left(ActiveCell.Address, Len(ActiveCell.Address) - 1)****Get
rest of Cell Referance
Address = Add & a*******Add both bits back together
ActiveCell.FormulaR1C1 = _
"=PROPER(VLOOKUP(Address,'List of User Names.xls'!Names,2,FALSE)&"
"&VLOOKUP(Address,'List of User Names.xls'!Names,3,FALSE))"****Formula
to be placed in Cell
End Sub
Regards Dean
(e-mail address removed)
www.dkso.co.uk/
http://homepage.ntlworld.com/dkso
I need a Macro button, to put a formula into a cell. This Cell will
always be 1(ONE) Cell above a users id but can be in different places
so it must be a macro.
The formula is used to perform a Lookup on the Cell below into a Range
held in a different spreadsheet.
What I have is below and it works EXCEPT the formula that is put into
each Cell has the word "Address" in it and not the actual referance
for the Cell
Is there a way to have this changed to the Cell Referance that I need
or is there a simpler way of doing it (probably knowing me)!
Thanks for any help provided....
Dean
VBA coding
Sub UserName()
ActiveCell.FormulaR1C1 = ActiveCell.Address ******Get ActiveCell
Referance
a = Right(ActiveCell.Address, 1)******Split off Right charater
a = a + 1*Add 1
Add = Left(ActiveCell.Address, Len(ActiveCell.Address) - 1)****Get
rest of Cell Referance
Address = Add & a*******Add both bits back together
ActiveCell.FormulaR1C1 = _
"=PROPER(VLOOKUP(Address,'List of User Names.xls'!Names,2,FALSE)&"
"&VLOOKUP(Address,'List of User Names.xls'!Names,3,FALSE))"****Formula
to be placed in Cell
End Sub
Regards Dean
(e-mail address removed)
www.dkso.co.uk/
http://homepage.ntlworld.com/dkso