Simple(ish) Excel Macro

  • Thread starter Thread starter preecy
  • Start date Start date
P

preecy

Does anyone have the code for a macro which would allow me to cop
certian cells (ie: A1:F5) from a unopened/hiden worksheet to an activ
cell on a different worksheet.

This is my attempt...
However it only works while working in test.xls and it needs to work o
any xls documents (new or old).


Sub test()
'
Windows("PERSONAL.XLS").Activate
Range("A1:F5").Select
Selection.Copy
Windows("test.xls").Activate *i beleive this is the problem*
ActiveSheet.Paste
Range("A2447").Select
End Sub

As you can see im new to this... any help appreciated
 
How about:

Sub test()
workbooks("personal.xls").worksheets("sheet1").range("a1:F5").copy _
destination:=activecell
End Sub

Adjust the sheet name in personal.xls to what you need.
 
Back
Top