LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default A better Macro for Copying Data

I am trying to create a better macro to copy data from one worksheet to the
next, the thing is, the worksheet I am copying from is not in the same format
as the worksheet I am copying to, therefore the values from worksheet 1 has
to go in different specific cells in worksheet 2, I recorded a macro below
and it works but I know it probably won't work for the other worksheets I
have since the name of the worksheets get changed sometimes, the recorded
macro can be seen below:

Sub Macro1()

Range("D3:D14").Select
Selection.Copy
ChDir "C:\Documents and Settings\jermaine_wanyou\Desktop\FACTBOOK SYSTEM"
Workbooks.Open Filename:= _
"C:\Documents and Settings\jermaine_wanyou\Desktop\FACTBOOK
SYSTEM\Argentina Bucket.xls"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("B7").Select
Application.WindowState = xlMinimized
Windows("Cal.xls").Activate
Range("E3:E14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Argentina Bucket.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("B8").Select
Windows("Cal.xls").Activate
Range("F3:F14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Argentina Bucket.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("B11").Select
Windows("Cal.xls").Activate
Range("G3:G14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Argentina Bucket.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("B12").Select
Windows("Cal.xls").Activate
Range("H3:H14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Argentina Bucket.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("B16").Select
Windows("Cal.xls").Activate
Range("I3:I14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Argentina Bucket.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("B13").Select
Windows("Cal.xls").Activate
Range("L3:L14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Argentina Bucket.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("B17").Select
Windows("Cal.xls").Activate
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
Range("M4:M14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Argentina Bucket.xls").Activate
Range("C17").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("A1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Argentina 2007"
Range("A1").Select
ActiveWorkbook.Save
ActiveWindow.Close
Range("H21").Select
End Sub

So I'm just wondering is there anyone who can help me with this
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro error - copying data twice Gretta Excel Discussion (Misc queries) 1 April 6th 07 08:14 PM
macro error - copying data twice Gretta Excel Discussion (Misc queries) 1 April 6th 07 04:40 PM
Macro for copying conditional data ipsy9 Excel Worksheet Functions 0 June 8th 06 08:19 PM
Macro Help - copying specific data Dave Excel Programming 1 April 22nd 05 07:08 AM
Copying Data into another worksheet using macro Andy W Excel Programming 1 February 19th 04 04:01 PM


All times are GMT +1. The time now is 01:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"