+ Reply to Thread
Results 1 to 12 of 12

Need to Save current sheet to one of two files depending on data ( Q or I)

  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Need to Save current sheet to one of two files depending on data ( Q or I)

    Hi there,

    I have some code below that converts the current sheet to a PDF then uses data from B16, H8 and H10 to save as its filename, then it saves it to a certain file.

    What I would like it to do is :

    1) Convert active sheet to PDF.
    2) Use the data from cells B16,H8 and H10 to save as the filename.
    3) Check to see if cell H8 contains the letter Q if true then save file to C:\Documents and Settings\carl.walker\My Documents\Quotations\.
    4) Check to see if cell H8 contains the letter I if true then save file to C:\Documents and Settings\carl.walker\My Documents\Invoices\.
    5) Oh and still use the IF's and msgboxes.

    I'm not really sure where to start to honest so any help would be much appreciated

    Thanks in advance
    Carl

    Please Login or Register  to view this content.
    Last edited by carlandtina02; 06-20-2013 at 12:49 PM. Reason: grammer lol

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Try this..

    Please Login or Register  to view this content.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Hi Deb,

    Thanks for replying, I've just ran the code but it's sprung up with a compile error (assignment to constant not permitted)?

    Please Login or Register  to view this content.
    Also forgot to add that I have taken away the reports folder and replaced it with a Quotation folder and a Invoice folder.


    Regards
    Carl
    Last edited by carlandtina02; 06-20-2013 at 06:11 PM. Reason: grammer lol

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    OOPS.. my appologize..

    Please delete keyword Const from the 1st line, and use just Dim

  5. #5
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Hi Deb,

    I just tried and its flagged up as "syntax error"?

    Please Login or Register  to view this content.
    Kind Regards
    Carl

  6. #6
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Hi,

    Can anyone help with this pretty pleeeeaaaaaaase?

    Regards
    Carl

  7. #7
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Hi Folks,

    Can anyone give me any advice with the above please?


    Thanks in advance
    Kind regards
    Carl

  8. #8
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Hi Carl!

    Sorry.. I missed this post.. ;(

    try this..
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Cheers Deb,

    Not a problem, I've just ran the code and it worked fine, Just one question..is there a way to make case Q or I non case sensitive because it saves to the report folder when they are in lowercase?

    Thanks for your help with this, it's much apreciated!

    Regards
    Carl

  10. #10
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Try This..

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Thanks Deb,

    It worked a treat.


    Kind Regards
    Carl

  12. #12
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Need to Save current sheet to one of two files depending on data ( Q or I)

    Thanks for the feedback..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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