Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try
Sub copyToAlternateSheets() Dim i As Integer Dim ws, dest As Worksheet Dim srcName, destName As String Dim wksNumber For Each ws In Worksheets wksNumber = CInt(Left(ws.Name, 2)) If (wksNumber Mod 2) = 1 Then srcName = ws.Name For Each dest In Worksheets If CInt(Left(dest.Name, 2)) = "0" & (wksNumber + 1) Then destName = dest.Name Exit For End If Next dest Worksheets(srcName).Activate ActiveSheet.Columns("J:J").Copy Worksheets(destName).Activate ActiveSheet.Range("J1").Select ActiveSheet.Paste End If Next ws End Sub "bioyyy" wrote: Joel and Sheelo: Thanks for your BIG help! But I made one big mistake in my question. The sheet names are not the same as I wrote Test. Actually, each sheet has different names (i.e. 05-ABC, 06-Test, 07-adge, 08-iesdf, .....For example). I hope you can help me to fix it. Thanks again, |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need Major Help on the Macro | Excel Discussion (Misc queries) | |||
Copying Sheets | Excel Worksheet Functions | |||
Copying sheets in a macro | Excel Discussion (Misc queries) | |||
Linking sheets into one major sheet? | Excel Worksheet Functions | |||
Copying Macro w/ different sheets | Excel Worksheet Functions |