If there is a constant cell on each sheet that
indicates the number of fixtures for that sheet,
you could also eliminate the input box by making
mult = that cell value. Otherwise you are stuck
with the input box. I did not test this revision,
but it should go through all the sheets in the
active workbook. Again, change sheet names and range
references to actual.
Sub GetBOM()
Dim rng As Range, sh1 As Worksheet, sh2 As Worksheet
For Each sh1 In ThisWorkbook.Sheets
If sh1.Name <> "Sheet2" 'To ignore if is summation sheet
Set sh2 = Sheets("Sheet2") 'Change as required
Set rng = sh1.Range("A2:A20")
mult = Application.InputBox("Enter the quantity of fixtures", _
"FIXTURE QTY", Type:=1)
For i = 1 To mult
x = sh2.Cells(Rows.Count, 1).End(xlUp).Offset(2).Address
rng.Copy sh2.Range(x)
Next
End If
Next
End Sub
<Kris Winntech> wrote in message news:(E-Mail Removed)...
> How would I loop this to make it work for all sheets in the workbook?
>
>
>
> JLGWhiz wrote:
>
> This assumes that the range containing the items is A2:A20.
> 09-Nov-09
>
> This assumes that the range containing the items is A2:A20. You can
> change
> that to the actual range. Also change the sheet names to the actual
> sheets
> used.
>
> Sub GetBOM()
> Dim rng As Range, sh1 As Worksheet, sh2 As Worksheet
> Set sh1 = ActiveSheet
> Set sh2 = Sheets("Sheet2") 'Change as required
> Set rng = sh1.Range("A2:A20")
> mult = Application.InputBox("Enter the quantity of fixtures", _
> "FIXTURE QTY", Type:=1)
> For i = 1 To mult
> x = sh2.Cells(Rows.Count, 1).End(xlUp).Offset(2).Address
> rng.Copy sh2.Range(x)
> Next
> End Sub
>
> Previous Posts In This Thread:
>
> EggHeadCafe - Software Developer Portal of Choice
> Working with Client Side Xml Data Islands from Server-Side ASP.NET code
> http://www.eggheadcafe.com/tutorials...ient-side.aspx