Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2002 and VB Macro

I'm trying to insert an Excel IF formula into cells where the logical test is
based on employee names. If the name is found, it returns the employee's
hourly rate, if not zero. Here is what I've done:

Do Until IsEmpty(ActiveCell.Offset(0, -11))
ActiveCell.FormulaR1C1 = "=IF(+RC[-5]="Smith, Joe",11,0)"
ActiveCell.Offset(1, 0).Select
Loop

The problem is too many "s. I need to include the formula in "" and the
string in "", but VB expects the first " of the string to be the end of the
argument.

How can I handle this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Excel 2002 and VB Macro

ActiveCell.FormulaR1C1 = "=IF(RC[-5]= ""Smith, Joe"" ,11,0)"

--

Vasant

"adavisRSC" wrote in message
...
I'm trying to insert an Excel IF formula into cells where the logical test

is
based on employee names. If the name is found, it returns the employee's
hourly rate, if not zero. Here is what I've done:

Do Until IsEmpty(ActiveCell.Offset(0, -11))
ActiveCell.FormulaR1C1 = "=IF(+RC[-5]="Smith, Joe",11,0)"
ActiveCell.Offset(1, 0).Select
Loop

The problem is too many "s. I need to include the formula in "" and the
string in "", but VB expects the first " of the string to be the end of

the
argument.

How can I handle this?

Thanks



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
Macro Help for Excel 2002 Somewhere In Excel 2002 Excel Discussion (Misc queries) 0 August 26th 07 01:20 AM
excel 2002 macro DaveF Excel Worksheet Functions 0 June 20th 07 05:37 PM
Macro not working in Excel 2002 cottage6 Excel Programming 5 October 29th 04 02:30 PM
Excel 2002 Macro to Execute SQL Statement David Weilmuenster[_2_] Excel Programming 0 July 15th 04 01:10 AM
Excel 2002 - Macro Security Arthur Braun Excel Programming 1 September 17th 03 02:55 PM


All times are GMT +1. The time now is 07:45 PM.

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"