toastytoast
New Member
- Joined
- Nov 21, 2012
- Messages
- 1
Hi All,
New to this forum and to macros so bear with me...
I am creating datasheets from a spread sheet, i already have a macro/vlookup combination set up so where i input a TAG into cell "AH2" it populates a number of datasheets and i can click a button that runs a macro to print out all datasheets that have been completed (the data sheets that are printed are based upon a vlookup that identifies a X in a number of boxes).
There are thousands tags and I need to print them out by filtering on column H which relates to the "System" the tags are associated with. This is so i can produce packs based upon systems which contain all the required datasheets.
So basically the macro needs to filter the data by "system" then cycle the values in a specific cell "AH2" and perform the print macro that i have already wrote after the "AH2" is changed each time until the macto reads blank then it needs to stop the cycle.
Ideally i would be able to put a system number into a cell and push a button and the datasheets would be populated and printed as described.
See below for my print code.
Thanks in advance for any help . . .
James,
Sub Button1_Click()
Sheets("Instrument Generator").Select
If Range("AH11").Value = "X" Then
Range("A1:O59").PrintOut
End If
If Range("AH10").Value = "X" Then
Range("P60:AH133").PrintOut
End If
If Range("AH9").Value = "X" Then
Range("AI134:BA193").PrintOut
End If
If Range("AH8").Value = "X" Then
Range("BB194:BT253").PrintOut
End If
If Range("AH7").Value = "X" Then
Range("BU254:CK313").PrintOut
End If
If Range("AH13").Value = "X" Then
Range("DL372:EK424").PrintOut
End If
End Sub
New to this forum and to macros so bear with me...
I am creating datasheets from a spread sheet, i already have a macro/vlookup combination set up so where i input a TAG into cell "AH2" it populates a number of datasheets and i can click a button that runs a macro to print out all datasheets that have been completed (the data sheets that are printed are based upon a vlookup that identifies a X in a number of boxes).
There are thousands tags and I need to print them out by filtering on column H which relates to the "System" the tags are associated with. This is so i can produce packs based upon systems which contain all the required datasheets.
So basically the macro needs to filter the data by "system" then cycle the values in a specific cell "AH2" and perform the print macro that i have already wrote after the "AH2" is changed each time until the macto reads blank then it needs to stop the cycle.
Ideally i would be able to put a system number into a cell and push a button and the datasheets would be populated and printed as described.
See below for my print code.
Thanks in advance for any help . . .
James,
Sub Button1_Click()
Sheets("Instrument Generator").Select
If Range("AH11").Value = "X" Then
Range("A1:O59").PrintOut
End If
If Range("AH10").Value = "X" Then
Range("P60:AH133").PrintOut
End If
If Range("AH9").Value = "X" Then
Range("AI134:BA193").PrintOut
End If
If Range("AH8").Value = "X" Then
Range("BB194:BT253").PrintOut
End If
If Range("AH7").Value = "X" Then
Range("BU254:CK313").PrintOut
End If
If Range("AH13").Value = "X" Then
Range("DL372:EK424").PrintOut
End If
End Sub