VBA Cycle a Value in a single specific Cell

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 . . . :nya:

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
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top