Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FIRSTROUNDKO via OfficeKB.com
 
Posts: n/a
Default Expected end of Statement

Hi,

I am getting the error "Expected end of Statement" for the below code
Please can somebody help me fix this.


Sub insert()

Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
..Range("D3:D" & LastRow).Formula = "=IF(OR(A3="CAR",A3="BUS",A3="TRAIN"),"X",
"")"
End With
End Sub

Thanks

Darren

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200604/1
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default Expected end of Statement

You must double the " within double-quotes.

Sub insert()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("D3:D" & LastRow).Formula = _
"=IF(OR(A3=""CAR"",A3=""BUS"",A3=""TRAIN""),""X"", """")"
End With
End Sub

HTH
--
AP

"FIRSTROUNDKO via OfficeKB.com" <u15639@uwe a écrit dans le message de
news:5e9ce4d01a841@uwe...
Hi,

I am getting the error "Expected end of Statement" for the below code
Please can somebody help me fix this.


Sub insert()

Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("D3:D" & LastRow).Formula =

"=IF(OR(A3="CAR",A3="BUS",A3="TRAIN"),"X",
"")"
End With
End Sub

Thanks

Darren

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200604/1



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MageeStringer
 
Posts: n/a
Default Expected end of Statement


"=IF(OR(A3=""CAR"",A3=""BUS"",A3=""TRAIN""),""X"", """")"

requires double quotes


--
MageeStringer
------------------------------------------------------------------------
MageeStringer's Profile: http://www.excelforum.com/member.php...o&userid=33298
View this thread: http://www.excelforum.com/showthread...hreadid=531841

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
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Returning expected dates London Excel Worksheet Functions 1 July 23rd 05 03:31 AM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM


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