Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Skankles
 
Posts: n/a
Default More Archiving Problems

Hello, everybody here.

I'm trying to move data from sheet 1("Data Central") to sheet
2("Archives") daily. Sheet 1 is a master sheet with =TODAY() in cell
C2, formulated dates in range C5:C29, blank space for hard data in
D5:D29 and K5:K29, and money calculating formulas everywhere else.

When the month in C2 changes, dates in C5:C29 change with the formula,
D5:D29 and K5:K29 are cleared out, and the money calculating formulas
display their starting values everywhere else.

I simply want to copy, from "Data Central," the date in C5 and the
corresponding hard data in D5 and K5 to "Archive," cells A5,B5 and C5.
The next day, "Data Central" cells C6, D6 and K6 should copy to
"Archive" cells A6, B6 and C6.

The following module will do this perfect-ly, IF both sourceRange and
destRange are unformatted.

Sub copy_1()
Dim sourceRange As Range
Dim destRange As Range
Dim Yo As Integer
Yo = 25 * (Month(Sheets("Data Central").Range("C2")) - 1) + 5
Set sourceRange = Sheets("Data
Central").Range("C5:C29,D5:C29,K5:K29")
Set destrange = Sheets("Sheet2").Cells(Yo, 1)
sourceRange.Copy destrange
End Sub

However, the real master sheet has conditional formatting in Column C
and K that dark out the days of that month we don't work (always
changing).

When I applied this Macro to my previously existing master sheet, it
froze it, shooting me back to the VBA screen with a message box saying
there was a Runtime Error '9' Subscript out of Range error. What is
this about?

How can this be gotten around? Basically, how do I tweak the macro to
copy only values of these cells and not formulas or formatting?

Thanks to anyone who tackles this issue.

James

Reply
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
problems with Sharing excel files mmayfield Excel Discussion (Misc queries) 0 January 22nd 05 08:45 PM
"Problems during load" Vincent Excel Discussion (Misc queries) 1 January 19th 05 08:38 PM
I am having problems creating pivot table of data wyman Charts and Charting in Excel 1 January 12th 05 05:17 PM
Problems opening Excel files using DFS links Byron Excel Discussion (Misc queries) 2 January 1st 05 11:31 PM
Problems with Excel formulas when 2002 upgraded to XP Kathi McGraw Excel Worksheet Functions 0 November 16th 04 05:27 PM


All times are GMT +1. The time now is 08:10 AM.

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

About Us

"It's about Microsoft Excel"