Hi,
Previously I had 1 listbox with the 52 weeks of the year. Listed WK 1 to WK 52.
I have change my userform now because the listbox was too long.
I now have 2 listboxes.
Listbox1 from WK 1 to WK 26.
ListBox2 from WK 27 to WK 52.
I have the following code that worked when it was just the 1 listbox:
I now need the code modifying so it works in ListBox2 as well.
Any help would be appreciated.
Thanks
Dan
Previously I had 1 listbox with the 52 weeks of the year. Listed WK 1 to WK 52.
I have change my userform now because the listbox was too long.
I now have 2 listboxes.
Listbox1 from WK 1 to WK 26.
ListBox2 from WK 27 to WK 52.
I have the following code that worked when it was just the 1 listbox:
Code:
[COLOR=#333333]Private Sub CommandButton1_Click()[/COLOR]
With Application
.ScreenUpdating = False
.Calculation = xlManual
With Sheets("Current weeks data")
.Cells.ClearContents
Sheets(ListBox1.Value).UsedRange.Copy
.Range("A1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
.UsedRange.Columns.Autofit
End With
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
[COLOR=#333333]End Sub[/COLOR]
I now need the code modifying so it works in ListBox2 as well.
Any help would be appreciated.
Thanks
Dan