Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formula in given via input box

Yep -Missed some of the Ampersands you put in - sorry

ActiveCell.FormulaR1C1 = "='" & segment & " - Exp & !R[-21]C - '" _
& segment & " - Rev & !R[-26]C"

should be

ActiveCell.FormulaR1C1 = "='" & segment & " - Exp'!R[-21]C - '" _
& segment & " - Rev'!R[-26]C"

so I should always bench test it in the immediate window:

segment = "HIO"
? "='" & segment & " - Exp'!R[-21]C - '" _
& segment & " - Rev'!R[-26]C"
='HIO - Exp'!R[-21]C - 'HIO - Rev'!R[-26]C

--
Regards,
Tom Ogilvy



"Patrick Molloy" wrote in message
...
ActiveCell.FormulaR1C1 = "='" & segment & " - Exp '!R[-21]C - '" _
& segment & " - Rev '!R[-26]C"

"Tom Ogilvy" wrote:

Or, fixing yours:

ActiveCell.FormulaR1C1 = "='" & segment & " - Exp & !R[-21]C - '" _
& segment & " - Rev & !R[-26]C"

--
Regards,
Tom Ogilvy


"Petr" wrote in message
om...
Hallo,
I have following problem. I would need to use the user values
submitted via inputbox into the formula of the following type:

ActiveCell.FormulaR1C1 = "='HIO - Exp'!R[-21]C-'HIO - Rev'!R[-26]C"

I.e. in this case the parameter "HIO" should be submitted via
inputbox.

I have the following code which ends with error.

Sub formula_input_test

IntgInput = InputBox("Submit the segment name (abbrev.)")

segment = IntgInput

Range("A1").Select
ActiveCell.FormulaR1C1 = "='& segment & - Exp & !R[-21]C - '& segment
& - Rev & !R[-26]C"

End Sub


Thanks a lot in advance for any suggestions.
Best regards, Petr Duzbaba






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
Formula to input value Gemi Excel Discussion (Misc queries) 4 April 1st 09 08:39 PM
formula numeric input seamaml Excel Discussion (Misc queries) 1 January 10th 06 04:12 AM
Relative input for formula Tom Excel Discussion (Misc queries) 1 November 11th 05 01:21 PM
input box = formula bar David494 Excel Discussion (Misc queries) 2 July 29th 05 03:44 PM
input box , msgbox, formula lost Excel Programming 3 April 14th 04 02:31 PM


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

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

About Us

"It's about Microsoft Excel"