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: 1
Default Runtime error 91 help


Today, I recorded a new macro to copy certain columns of one workbook t
a report template.

Because every month I will need to copy new data of the same forma
from a new workbook to the report template I tried using th
personal.xls to make that macro available to all workbooks

I tried to setup a variable for the workbook, so the code will work o
all workbooks. Here is what I have so far. I get a runtime error 91
object variable or with block variable not set.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 5/15/2006 by CHEUANDK
'
' Keyboard Shortcut: Ctrl+s
'
dim curBook as workbook

curBook = activeworkbook.name


Range("E3:E4000").Select
Selection.Copy
Windows("PERSONAL.XLS").Activate
Windows("Large Amount Report By ARM Templete.xls").Activate
Range("A10").Select
ActiveSheet.Paste

Workbooks(curBook).Activate
Range("D3:D4000").Select
Selection.Copy

Windows("Large Amount Report By ARM Templete.xls").Activate
Range("B10").Select
ActiveSheet.Paste

Workbooks(curBook).Activate
Range("H3:I4000").Select
Selection.Copy

Windows("Large Amount Report By ARM Templete.xls").Activate
Range("C10").Select
ActiveSheet.Paste


End Sub

Can someone adjust this code, your help is appreciated

--
hachirok
-----------------------------------------------------------------------
hachiroku's Profile: http://www.excelforum.com/member.php...fo&userid=3403
View this thread: http://www.excelforum.com/showthread.php?threadid=54205

 
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
xpath error? Runtime Error 13 type mismatch SteveM Excel Discussion (Misc queries) 1 December 4th 07 09:16 AM
runtime error: syntax error or access violation oucsester[_2_] Excel Programming 1 May 3rd 06 05:51 PM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 07:27 PM.

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"