Brian B: Copy values between workbooks

J

Jonsson

Hi, Brian

I´ve done my homework and succeed!
Thanks for your effort to help me. (The coffe was a god idea!)

Below you find the formula I created/recorded.

Sub Copyoldtonew()
'
' Copyoldtonew Makro
' Makrot inspelat 2004-01-28 av Jonsson
'

Windows("Sch20041H.xls").Activate
Application.CutCopyMode = False
ActiveWindow.DisplayWorkbookTabs = True
Sheets(Array("V1", "V2", "V3", "V4", "V5", "V6", "V7", "V8", "V9"
"V10", "V11", "V12", _
"V13", "V14", "V15", "V16", "V17", "V18", "V19", "V20", "V21"
"V22", "V23", "V24", "V25")) _
.Select
Sheets(Array("V26", "V27", "V28", "V29", "V30", "V31", "V32"
"V33", "V34", "V35", "V36", _
"V37", "V38", "V39", "V40", "V41", "V42", "V43", "V44", "V45"
"V46", "V47", "V48", "V49", _
"V50")).Select Replace:=False
Sheets(Array("V51", "V52", "V1-2002")).Select Replace:=False
Sheets(Array("V1U", "V2U", "V3U", "V4U", "V5U", "V6U", "V7U"
"V8U", "V9U", "V10U", "V11U", "V12U", _
"V13U", "V14U", "V15U", "V16U", "V17U", "V18U", "V19U", "V20U"
"V21U", "V22U", "V23U", "V24U", "V25U")) _
.Select
Sheets(Array("V26U", "V27U", "V28U", "V29U", "V30U", "V31U"
"V32U", "V33U", "V34U", "V35U", "V36U", _
"V37U", "V38U", "V39U", "V40U", "V41U", "V42U", "V43U", "V44U"
"V45U", "V46U", "V47U", "V48U", "V49U", _
"V50U")).Select Replace:=False
Sheets(Array("V51U", "V52U", "V1-2002U")).Select Replace:=False
Range("B3:D32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Sheets(Array("V1", "V2", "V3", "V4", "V5", "V6", "V7", "V8", "V9"
"V10", "V11", "V12", _
"V13", "V14", "V15", "V16", "V17", "V18", "V19", "V20", "V21"
"V22", "V23", "V24", "V25")) _
.Select
Sheets(Array("V26", "V27", "V28", "V29", "V30", "V31", "V32"
"V33", "V34", "V35", "V36", _
"V37", "V38", "V39", "V40", "V41", "V42", "V43", "V44", "V45"
"V46", "V47", "V48", "V49", _
"V50")).Select Replace:=False
Sheets(Array("V51", "V52", "V1-2002")).Select Replace:=False
Sheets(Array("V1U", "V2U", "V3U", "V4U", "V5U", "V6U", "V7U"
"V8U", "V9U", "V10U", "V11U", "V12U", _
"V13U", "V14U", "V15U", "V16U", "V17U", "V18U", "V19U", "V20U"
"V21U", "V22U", "V23U", "V24U", "V25U")) _
.Select
Sheets(Array("V26U", "V27U", "V28U", "V29U", "V30U", "V31U"
"V32U", "V33U", "V34U", "V35U", "V36U", _
"V37U", "V38U", "V39U", "V40U", "V41U", "V42U", "V43U", "V44U"
"V45U", "V46U", "V47U", "V48U", "V49U", _
"V50U")).Select Replace:=False
Sheets(Array("V51U", "V52U", "V1-2002U")).Select Replace:=False
Range("B3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("Sch20041H.xls").Activate
Range("K3:M32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Range("K3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("Sch20041H.xls").Activate
Range("T3:V32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Range("T3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("Sch20041H.xls").Activate
Range("AC3:AE32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Range("AC3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("Sch20041H.xls").Activate
Range("AL3:AN32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Range("AL3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("Sch20041H.xls").Activate
Range("AU3:AW32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Range("AU3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("Sch20041H.xls").Activate
Range("BD3:BF32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Range("BD3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("Sch20041H.xls").Activate
Sheets(Array("Grund 1", "Grund 2", "Grund 3", "Grund 4", "Grund 5",
"Grund 6", _
"Grund 7", "Grund 8", "Grund 9", "Grund 10")).Select
Sheets("Grund 1").Activate
Range("B3:V32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Sheets(Array("Grund 1", "Grund 2", "Grund 3", "Grund 4", "Grund 5",
"Grund 6", _
"Grund 7", "Grund 8", "Grund 9", "Grund 10")).Select
Sheets("Grund 1").Activate
Range("B3:V32").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

Windows("Sch20041H.xls").Activate
Sheets("Namn").Activate
Range("C3:G32").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Sch2004H.xls").Activate
Sheets("Namn").Activate
Range("C3:G32").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Windows("Sch20041H.xls").Activate
Application.CutCopyMode = False
ActiveWindow.DisplayWorkbookTabs = False
ActiveWorkbook.RunAutoMacros Which:=xlAutoClose
ActiveWindow.Close
Windows("Sch2004H.xls").Activate
Sheets("Meny").Select
ActiveWindow.DisplayWorkbookTabs = False

End Sub

As you can see it´s quite hard to explain what I wanted to do, so I
recorded the most of it instead. Maybe it´s possible to edit some
"trash"?


//Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top