hi, I have a macro that is missing a sysntax IF, then statement or an error
I get compile error, please help.Please Login or Register to view this content.
hi, I have a macro that is missing a sysntax IF, then statement or an error
I get compile error, please help.Please Login or Register to view this content.
Last edited by chubbychub; 10-08-2016 at 02:15 PM.
Maybe try:Please Login or Register to view this content.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
I get compile error, not optional format message.
Last edited by chubbychub; 10-08-2016 at 03:45 PM.
Can any VBA master help me please?
The dot at the beginning of the statement says to use a reference established by a prior With statement, which your code doesn't contain. That's why TMS suggested ThisWorkbook.Export -- but only you know what the code is supposed to do, and you haven't shared that.
Did you write this code, and if not, where did it come from?
Entia non sunt multiplicanda sine necessitate
I just copied the code from a tutorial and add it in
The code was missing the statement?
Again, what are you trying to do?
just save the file into pdf format, I read tutorials and change the 2 lines in red and it works, but not sure if its right, I just saw all the tutorials having it so I change it and it works, please tell me if its right.
Please Login or Register to view this content.
If it works, and it does what you want, it's probably right. The issue is that you have code that you do not understand.
You would be better off recording a macro while you save your fie as a .pdf and see what you get.
what does this 2 lines means :
Dim strFilename As String <----------------------THIS LINE WAS ADDED
Dim rngRange As Range <---------------------- THIS LINE WAS ADDED
See: http://www.thespreadsheetguru.com/bl...ing-vba-macros and https://msdn.microsoft.com/en-us/library/7ee5a7s1.aspx or https://msdn.microsoft.com/en-us/lib.../gg264241.aspx
Or just Google Excel VBA Dim
Thanks for the rep.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks