View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Sheeloo[_3_] Sheeloo[_3_] is offline
external usenet poster
 
Posts: 1,805
Default NEED a MAJOR help with SHEETS copying MACRO

Try the macro
'Note: No error checking
Sub copyToAlternateSheets()
Dim i As Integer
Dim ws As Worksheet
Dim srcName, destName As String

For i = 5 To 13 Step 2
If i < 10 Then
srcName = "0" & i & "-Test"
destName = "0" & (i + 1) & "-Test"
Else
srcName = i & "-Test"
destName = (i + 1) & "-Test"
End If
If i = 9 Then
srcName = "0" & i & "-Test"
destName = (i + 1) & "-Test"
End If
Set ws = Worksheets(srcName)
If (ws.Name < "") Then
Worksheets(srcName).Activate
ActiveSheet.Columns("J:J").Copy
Worksheets(destName).Activate
ActiveSheet.Range("J1").Select
ActiveSheet.Paste
End If
Next i
End Sub


"bioyyy" wrote:

Hello,

I am trying to copy and column J from an odd number (starting from 05) sheet
to even number sheet:

For example:

copy Column J of 05-Test (Sheet name) and paste column J of 06-Test (Sheet
name)

so on for 07-Test to 08-Test, Up to 25-Test to 26-Test.


Thanks