Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Inputbox question

Nancy,

Untested, but try

Dim DSName As String

DSName = InputBox("Enter todays Portfolio Name")

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


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Nancy" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Inputbox question

I tried your code, but got the same error message. any
other suggestions?

tks.

-----Original Message-----
Nancy,

Untested, but try

Dim DSName As String

DSName = InputBox("Enter todays Portfolio Name")

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

DSName & ")"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Nancy" wrote in

message
...
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.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Inputbox question

ActiveCell.FormulaR1C1 = "=IF(RC[-1]="""","""",""" & DSName & """)"

Tested using Excel 97SR2 on Windows 98SE,

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

I tried your code, but got the same error message. any
other suggestions?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
InputBox / VBA question ok = print, cancel = exit todd78 Excel Worksheet Functions 4 August 9th 07 04:42 PM
Another InputBox question... Phil Excel Discussion (Misc queries) 4 April 12th 07 03:37 PM
inputbox question redb Excel Discussion (Misc queries) 0 October 6th 05 02:57 PM
Application.Inputbox Question ndp Excel Programming 3 December 8th 03 06:12 PM
InputBox to get user hidden columns question Stuart[_5_] Excel Programming 1 August 1st 03 07:50 PM


All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"