marco issues

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I am new to here, and have a question. I have figured out how I want to
make the input box, but not how to incorpoarate the answer to my fomula.

What I need to do is add a cell address to a formula, but I need to change
the cell address to run different resaults.

What I have so far is very simple as I am trying to get it to work before I
try it on the main workbook.
Res = InputBox("What is the cell address?")
If StrPtr(Res) = 0 Then
MsgBox "User Clicked Cancel"
ElseIf Res = vbNullString Then
MsgBox "User Clicked OK with no input"
Else
MsgBox "User Entered cell " & Res
End If
'
ActiveCell.FormulaR1C1 = "=R[-1]C[2] + 0 "
Range("D7").Select

Where 0 is I want to put the resualts of the cell I have just entered. Any
suggestions? Thanks in advance!
 
ActiveCell.FormulaR1C1 = "=R[-1]C[2] + 0 "

Try

ActiveCell.FormulaR1C1 = "=R[-1]C[2] + " & Res


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



Melody said:
Hi I am new to here, and have a question. I have figured out how I want
to
make the input box, but not how to incorpoarate the answer to my fomula.

What I need to do is add a cell address to a formula, but I need to change
the cell address to run different resaults.

What I have so far is very simple as I am trying to get it to work before
I
try it on the main workbook.
Res = InputBox("What is the cell address?")
If StrPtr(Res) = 0 Then
MsgBox "User Clicked Cancel"
ElseIf Res = vbNullString Then
MsgBox "User Clicked OK with no input"
Else
MsgBox "User Entered cell " & Res
End If
'
ActiveCell.FormulaR1C1 = "=R[-1]C[2] + 0 "
Range("D7").Select

Where 0 is I want to put the resualts of the cell I have just entered.
Any
suggestions? Thanks in advance!
 

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