+ Reply to Thread
Results 1 to 6 of 6

Correct sytax for using a range n VBA

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Correct sytax for using a range n VBA

    I am trying to check if a folder exits, and if not, create it (folder name is WOD). I am then trying to save the file as the contents of a cell which is found on a different sheet from where the macro is run, the sheet being Multiple and the cell being G9. The code falls over at the Range("Multiple!G9") part so I obviously have the syntax wrong but I am not sure what it should be. Help please!


    Please Login or Register  to view this content.
    Last edited by BRISBANEBOB; 11-14-2013 at 09:12 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,615

    Re: Correct sytax for using a range n VBA

    Filename:="C:\WOD\" & Sheets("Multiple").Range("G9").Value
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Correct sytax for using a range n VBA

    Using the code I am bnnow generating a syntax tax error on line FileFormat:=52, CreateBackup:=False

    Please Login or Register  to view this content.
    Can anyone help?

    Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Correct sytax for using a range n VBA

    You need a comma, space, and underscore on the preceding line.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Correct sytax for using a range n VBA

    Thanks a lot, I was going crazy! Works perfectly now.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Correct sytax for using a range n VBA

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Range Address Is Correct Columns Count Is Not Correct
    By goss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2013, 12:47 PM
  2. [SOLVED] long line in the macro code giving sytax error
    By hnpsingh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2012, 12:46 PM
  3. Trying to select a range prior to deleting it so i can verify correct range removed
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2011, 08:59 PM
  4. sytax to select next row
    By artromanov in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2007, 10:00 PM
  5. Replies: 2
    Last Post: 04-01-2006, 02:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1