another macro questions
I did figure out what I was doing wrong with typing in the cell. Now to get
the darn thing to say what it is named :-)
It still isn't naming it target_cusp, but
if I ask it to go to the target_cusp it will go to that cell.
Res = InputBox("What is the cell address?")
Do
If StrPtr(Res) = 0 Then
MsgBox "User Clicked Cancel"
Exit Sub
ElseIf Res = vbNullString Then
MsgBox "User Clicked OK with no input"
Else
MsgBox "User Entered cell " & Res
End If
Loop Until Res 0
ActiveWorkbook.Names.Add Name:="target_cusip", RefersToR1C1:=Range(Res)
Application.Goto Reference:="target_cusip"
ActiveCell.FormulaR1C1 = Res
I know it has to do with something I either forgot and have entered wrong,
I'm just not sure what or where....
"Jim Jackson" wrote:
I added a line:
ActiveWorkbook.Names.Add Name:="target_cusip", RefersToR1C1:=Range(Res)
to the code below. This applies the named range "target_cusip" to the cell
entered in the input box.
Res = InputBox("What is the cell address?")
Do
If StrPtr(Res) = 0 Then
MsgBox "User Clicked Cancel"
Exit Sub
ElseIf Res = vbNullString Then
MsgBox "User Clicked OK with no input"
Else
MsgBox "User Entered cell " & Res
End If
Loop Until Res 0
ActiveWorkbook.Names.Add Name:="target_cusip", RefersToR1C1:=Range(Res)
Application.Goto Reference:="target_cusip"
ActiveCell.FormulaR1C1 = Res
Application.Run "RefireBLP"
ActiveWorkbook.Names.Add Name:="target_cusip"
'RefersToR1C1: x_ "=summary!+ " & rng.Address(ReferenceStyle:=xlR1C1)
Application.Run "RefireBLP"
--
Best wishes,
Jim
"Melody4572" wrote:
I think it might, but I would need to see it to understand what you are
saying...forgive me for being dense but I think I can only see what's in my
mind. Maybe I am looking at it wrong. It's only going to move around 10
cells all in column M all one nect to the other..hmmm. Mabye.
"merjet" wrote:
It seems you are trying to move the name target_cusip around. Wouldn't
it be easier to leave its address fixed and copy the cusip (indicated
by the InputBox) to it?
Merjet
|