percy4
07-01-2009, 01:36 AM
Hi All,
I am currently trying to put together a macro that will select multiple sheets and copy and paste values from one column to another. The macro has to work regardless of how many sheets there are in the workbook.
What I was thinking is that I can’t use the index no. since I don’t know how many sheets there are in that workbook. So what I want is to select all sheets but a number of fixed names.
How can I do this? I’ve tried following but I cant get it to work.
Sub test()
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
Select Case ws.Name
Case "Article and quantities", "summary"
ws.Select
Case Else
ws.Select False
End Select
Next ws
Sheets(1).Activate
Range("A6").Select
Application.ScreenUpdating = True
End Sub
Thanks for your help!
BR
Per
I am currently trying to put together a macro that will select multiple sheets and copy and paste values from one column to another. The macro has to work regardless of how many sheets there are in the workbook.
What I was thinking is that I can’t use the index no. since I don’t know how many sheets there are in that workbook. So what I want is to select all sheets but a number of fixed names.
How can I do this? I’ve tried following but I cant get it to work.
Sub test()
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
Select Case ws.Name
Case "Article and quantities", "summary"
ws.Select
Case Else
ws.Select False
End Select
Next ws
Sheets(1).Activate
Range("A6").Select
Application.ScreenUpdating = True
End Sub
Thanks for your help!
BR
Per