manipulate / perform math on cell location a=a+1

  • Thread starter Thread starter mmadden2
  • Start date Start date
M

mmadden2

hi all,

i have a formula that results in...

variable 'NBCell' = $I$102

how can i change this value's column letter or row number?

for example, how can i...

change $I$102 into $A$102 (I turns into A)
change $I$102 into $I$104 (102 + 2 = 104)
change $I$102 into $A$104 (I turns into A and 102 + 2 = 104)

thank you very much,

marc
 
Your question is a little thin on exactly what you are up to but here is a
general answer...

sub Test
dim strAddress as string
dim strAddressNew as string
strAddress = $I$102
strAddressNew = cells(range(strAddress).row, "A").address
msgbox strAddressNew
strAddressNew = range(strAddress).offset(2, 0).address
msgbox strAddressNew
strAddressNew = cells(range(strAddress).row + 2, "A").address
msgbox strAddressNew
end sub
 

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

Back
Top