Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Creating A Macro Using an Input Table - Another Attempt (https://www.askmehelpdesk.com/showthread.php?t=305256)

  • Jan 18, 2009, 10:03 AM
    toveyb
    Creating A Macro Using an Input Table - Another Attempt
    In my posting yesterday, it was being intreprete that I wanted someone to breach security and that was very much not the case.

    What I was trying to attempt is to hopefully have someone help me duplicate the macro so I can put it in my document because I don't have to access to get to the coding in the original document in which the macro is containe.

    I have the sample file that shows the macro that I need to be duplicated.

    In summary, when the macro is ran that an input talbe will pop up prompting me to enter a numerical value (ie. 1) to the question" "Copies Start At", in the second input table it will ask "Copies End At" (ie. 6)an a numerical value will be entered.

    Based on the criteria entered above, the macro will enter a designated cell an the footer note Tag #1, 2, 3, 4, 5, 6. As a result, I will end up with 6 different pages labeled sequentially, based on one template spreadsheet.

    If anyone can help me, I would appreciate it. If my explanation is not clear, as mentioned above, I do have a sample to provide.

    Thanks!
  • Jan 18, 2009, 10:07 AM
    JudyKayTee
    Quote:

    Originally Posted by toveyb View Post
    In my posting yesterday, it was being intreprete that I wanted someone to breach security and that was very much not the case.

    What I was trying to attempt is to hopefully have someone help me duplicate the macro so I can put it in my document because I don't have to access to get to the coding in the original document in which the macro is containe.

    I have the sample file that shows the macro that I need to be duplicated.

    In summary, when the macro is ran that an input talbe will pop up prompting me to enter a numerical value (ie. 1) to the question" "Copies Start At", in the second input table it will ask "Copies End At" (ie. 6)an a numerical value will be entered.

    Based on the criteria entered above, the macro will enter in a designated cell an the footer note Tag #1, 2, 3, 4, 5, 6. As a result, I will end up with 6 different pages labeled sequentially, based on one template spreadsheet.

    If anyone can help me, I would appreciate it. If my explanation is not clear, as mentioned above, I do have a sample to provide.

    Thanks!



    I'm a little cofused - I work with macros ALL the time, some of them quite complicated, because I do a lot of legal research, legal reports.

    What is it that you want the macro to do? I don't understand who write the original macro and why you can't ask that person.
  • Jan 18, 2009, 10:17 AM
    toveyb
    This document was created by someone that is no longer with our organizatiobn last year when we were doing inventory. And no one else in my are is familiar with macros.

    I need to create something called tag sheets. These tag sheets must have a unique numerical identifier for how ever many I need. For example, if I need 100 tag sheets, I need each tag sheet to be labeled individually from 1 to 100. It needs to be labeled in two places: in a cell at the top and in the footer.

    This macro that was created enables the sheet to be automatically labeled based on the criteria entered into the input tables. As a result, instead of me having to print off 100 sheets and manually number them, the macro will enter the value for me and then print off the sheet.

    I hope this is more clear.
  • Jan 18, 2009, 11:11 AM
    JudyKayTee
    Quote:

    Originally Posted by toveyb View Post
    This document was created by someone that is no longer with our organizatiobn last year when we were doing inventory. And no one else in my are is familiar with macros.

    I need to create something called tag sheets. These tag sheets must have a unique numerical identifier for how ever many I need. For example, if I need 100 tag sheets, I need each tag sheet to be labeled individually from 1 to 100. It needs to be labeled in two places: in a cell at the top and in the footer.

    This macro that was created enables the sheet to be automatically labeled based on the criteria entered into the input tables. As a result, instead of me having to print off 100 sheets and manually number them, the macro will enter the value for me and then print off the sheet.

    I hope this is more clear.



    I'm not familiar with tag sheets but I am familiar with macros. Are you talking about printing tag sheets (? ) all at one time OR are you talking about printing one now and one then?
  • Jan 18, 2009, 01:16 PM
    toveyb
    The tag sheets is the name of the document

    Yes, I am talking about printing the sheets all at one time with each sheet automatically labeled with a number based on the criteria provided in the input table using a macro.

    If you need an example of the macro in which I need duplicated I will provide one, maybe it will be easier if you can see it.
  • Jan 22, 2009, 01:02 AM
    JBeaucaire

    Here are a couple of macros that do what you require. You should be able to adapt them for your needs. Be sure to test with a small # of printouts.

    This example will print ? Copies of the same sheet (It use a Input box to ask you how many) It will copy the page number in cell A1 or in the Header or Footer.

    Note: you can use this for testing .PrintOut preview:=True
    Code:

    Sub PrintCopies_ActiveSheet_1()
        Dim CopiesCount As Long
        Dim CopyNumber As Long
        CopiesCount = Application.InputBox("How many copies do you want", Type:=1)

        For CopyNumber = 1 To CopiesCount
            With ActiveSheet
                ' This example print the number in cell A1
                .Range("A1").Value = CopyNumber & " of " & CopiesCount

                'If you want the number in the footer use this line
                '.PageSetup.LeftFooter = CopyNumber & " of " & CopiesCount

                'Print the sheet
                .PrintOut
            End With
        Next CopyNumber
    End Sub


    The example below continue printing where It left off, such as today you print numbered pages 1-25 and the next time when you enter 10 in the input box it print 26-35.

    Code:

    Sub PrintCopies_ActiveSheet_2()
    ' This example print the number in cell A1
        Dim CopiesCount As Long
        Dim CopyNumber As Long
        CopiesCount = Application.InputBox("How many copies do you want", Type:=1)

        With ActiveSheet
            If Not IsNumeric(.Range("A1").Value) Then .Range("A1").Value = 0

            For CopyNumber = 1 To CopiesCount
                .Range("A1").Value = .Range("A1").Value + 1

                'Print the sheet
                .PrintOut

            Next CopyNumber
        End With
    End Sub

    (Code Source)
  • Jan 22, 2009, 07:54 AM
    toveyb
    Hi There,

    This is great, I have revised the copy count for cell A1 to meet my needs, but I am unable revise the coding so the same information shows up in the footer.

    Am I not able to have it in both places, or can it only be one or the other. Your assistance is appreciated.

    Code I Was Provided Inititally:

    Sub PrintCopies_ActiveSheet_1()
    Dim CopiesCount As Long
    Dim CopyNumber As Long
    CopiesCount = Application.InputBox("How many copies do you want", Type:=1)

    For CopyNumber = 1 To CopiesCount
    With ActiveSheet
    ' This example print the number in cell A1
    .Range("A1").Value = CopyNumber & " of " & CopiesCount

    'If you want the number in the footer use this line
    '.PageSetup.LeftFooter = CopyNumber & " of " & CopiesCount

    'Print the sheet
    .PrintOut
    End With
    Next CopyNumber
    End Sub

    [U]My Revised Coding, But Footer Not Working[U]

    Sub PrintCopies_ActiveSheet_1()
    Dim CopiesCount As Long
    Dim CopieNumber As Long
    CopiesCount = Application.InputBox("How many copies do you want", Type:=1)

    For CopieNumber = 1 To CopiesCount
    With ActiveSheet
    .Range("A1").Value = " Tag " & CopieNumber

    '.PageSetup.RightFooter = " Tag" & CopieNumber

    'Print the sheet
    .PrintOut
    End With
    Next CopieNumber
    End Sub
  • Jan 22, 2009, 11:42 AM
    JBeaucaire

    That line is commented out in the code, meaning it's turned off. To activate it, remove the ' (apostrophe) from the beginning of the line for the footer.

    You'll know it's active when that line changes color back to match the rest of the active code. Comment lines usually appear in an off-color.

  • All times are GMT -7. The time now is 02:11 AM.