+ Reply to Thread
Results 1 to 4 of 4

MACRO - Auto change value in validation and save

  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    2013
    Posts
    68

    MACRO - Auto change value in validation and save

    Hi everyone. (Sorry can't attach file sample due to privacy setting of my company)

    I have a report that has a Data Validation (drop down) in worksheet "TEMPLATE" cell "B1". What I do is I change the value of B1 and the rest of the sheet updates based on formula. Then I save it to PDF (only the TEMPLATE worksheet) with the filename set as the VALUE of B1 to a certain folder in my local drive.

    Then I repeat the process until all the list is done.

    What I what to do is to automate the process using MACRO if possible.

    NOTE: It doesn't have to be a validation. As long as all data in my list are accounted. My list is in worksheet "VALIDATION" cell "A:A"



    Thank you
    Last edited by acerlaptop; 02-13-2020 at 03:41 AM.

  2. #2
    Forum Guru Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    11,641

    Re: MACRO - Auto change value in validation and save

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    2013
    Posts
    68

    Re: MACRO - Auto change value in validation and save

    Sorry can't attach file sample due to privacy setting of my company

  4. #4
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    2013
    Posts
    68

    Re: MACRO - Auto change value in validation and save

    Quote Originally Posted by acerlaptop View Post
    Hi everyone. (Sorry can't attach file sample due to privacy setting of my company)

    I have a report that has a Data Validation (drop down) in worksheet "TEMPLATE" cell "B1". What I do is I change the value of B1 and the rest of the sheet updates based on formula. Then I save it to PDF (only the TEMPLATE worksheet) with the filename set as the VALUE of B1 to a certain folder in my local drive.

    Then I repeat the process until all the list is done.

    What I what to do is to automate the process using MACRO if possible.

    NOTE: It doesn't have to be a validation. As long as all data in my list are accounted. My list is in worksheet "VALIDATION" cell "A:A"



    Thank you
    I've tried this Macro but it ends up in error with the highlighted part:

    Sub GREEN()
    '
    ' GREEN Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+G
    Sheets("VALIDATION").Activate
    Range("A1").Select

    Do While True
    If Selection.Value = "" Then
    Exit Do
    Else
    Selection.Copy
    Sheets("TEMPLATE").Activate
    Range("B1").Activate
    ActiveSheet.Paste

    Dim Path As String
    Dim filename As String
    Path = "H:\TEST\"
    filename = Range("B1")
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:=Path & filename & ".pdf", _
    Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False


    Sheets("VALIDATION").Activate
    Selection.Offset(1, 0).Select

    End If
    Loop
    End Sub

+ 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. Replies: 5
    Last Post: 11-17-2017, 04:43 PM
  2. [SOLVED] Auto update cell with validation list
    By wrybel in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-31-2017, 05:33 AM
  3. [SOLVED] Auto email loop with formatted table data breaking on second loop VBA
    By Who_else in forum Excel General
    Replies: 6
    Last Post: 03-24-2016, 06:22 AM
  4. Auto fill one cell from a Data Validation List
    By brianwoodburn in forum Excel General
    Replies: 9
    Last Post: 10-12-2014, 11:38 AM
  5. Replies: 8
    Last Post: 10-11-2014, 09:35 AM
  6. Macro to loop through data validation saving extract results as text files
    By Jugo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:53 PM
  7. Loop Macro to Auto Format Borders
    By algirard8 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-19-2010, 09:03 AM

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