• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Syntax Error

bobhc

Excel Ninja
Good day All


I keep getting a VBE syntax error with this line of code


Worksheets(“Percentage_Increase”).Range(“A1:C3”).Value = 12.5


probably wrong but I think it may be some thing to do with the : separator.
 
Hi Bob ,


I don't get an error ; I had to replace the double quote symbols with the real double quote characters.


Narayan
 
Good day NARAYANK991


Many thanks for that..lesson learned,...keep an eye on the copy and paste :)......but I now have this "subscript out of range " in the same line of code
 
Code:
Worksheets("Percentage_Increase").Range("A1:C3").Value = 12.5

Works fine


Make sure if you copied/pasted the code that you re-type the quotation marks " 's


Make sure that the sheet is called "Percentage_Increase" without the quotes

Make sure there are no leading or trailing spaces on the sheet name
 
Hui again I find myself in the most likable position of say thank you, I acted on your post and found a trailing space on the sheet name. Lesson learned and filed away in the grey cells
 
Bobhc


Surprisingly this is a very common mistake, which I just posted about in another post.


:)
 
Back
Top