View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nancy[_4_] Nancy[_4_] is offline
external usenet poster
 
Posts: 8
Default Inputbox question

I have an input box in the beginning of my macro that ask
for a string to be entered into a cell B2. Then copied
down. But i'm getting a #NAME? error in the cells.

Here is the code i am using.

Dim DSName As String

DSName = InputBox("Enter todays Portfolio Name")

Range("B2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]="""","""",DSName)"

Any suggestions? Thank You.