Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Enter formula by code.

Hi All

can anyone help. I cant seem to get this to work.

I keep getting run time error 1004

application or object defined error.

Public Sub TLIdentify()

finalrow = Worksheets("INV Bookings").Range("B65536").End(xlUp).Row

Worksheets("INV Bookings").Range("AV26:AV" & finalrow).FormulaR1C1 =
"=IF(OR(RC[-38]0,RC[-32]0,RC[-26]0,RC[-20]0,RC[-14]0,RC[-8]0,RC[-2]0),VLOOKUP(RC4,'Team Summary'!R4C3:R16C4,2,0),"")"

End Sub
--
Regards and Thanks for any assistance.

Francis Brown.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Enter formula by code.

On Sun, 21 Feb 2010 10:45:01 -0800, Francis Brown
wrote:

Hi All

can anyone help. I cant seem to get this to work.

I keep getting run time error 1004

application or object defined error.

Public Sub TLIdentify()

finalrow = Worksheets("INV Bookings").Range("B65536").End(xlUp).Row

Worksheets("INV Bookings").Range("AV26:AV" & finalrow).FormulaR1C1 =
"=IF(OR(RC[-38]0,RC[-32]0,RC[-26]0,RC[-20]0,RC[-14]0,RC[-8]0,RC[-2]0),VLOOKUP(RC4,'Team Summary'!R4C3:R16C4,2,0),"")"

End Sub


You have to double your "s in the end of the IF statement.
As the formula is inside a long string a single " will be interpreted
as the end of this string rather than a " that is to be part of the
formula.

Change you formula like this:

......R16C4,2,0),"""")"

and say good bye to the error 1004 :-)

Hope this helps / Lars-Åke
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
NOT ABLE TO ENTER VB CODE SANDIND Excel Programming 1 May 26th 08 04:53 PM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM
ALT + enter or Char(13) in code JL Excel Discussion (Misc queries) 3 April 8th 05 05:27 PM
Enter VBA Code Password Eddie Excel Programming 3 December 2nd 04 02:30 PM
Code to enter formula w/ relative row ref? Ed[_9_] Excel Programming 5 October 1st 03 08:37 PM


All times are GMT +1. The time now is 06:03 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"