LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ray Ray is offline
external usenet poster
 
Posts: 267
Default Inconsistent Code?

Hi -

This is really strange ... I have a large macro that moves data from
one book to another. The basic code is like this:
basebook.Sheets("Hours Act").Cells.Copy
Destination:=HoursFile.Sheets("Hours Act").Range("A1")
HoursFile.Sheets("Hours Act").UsedRange.Value =
HoursFile.Sheets("Hours Act").UsedRange.Value

This same code is repeated for all sheets in the 'basebook' file and
is used to consolidate approx 35 workbooks (identical). The code
works great for 34 of the workbooks, and really works fine in the 35th
book ... except ONE sheet errors out!? Why would this happen?
(NOTE: it's the 2nd line that gets highlighted on error)

I get the dreaded 'Run-time 1004: Application-Defined or Object-
defined' error. But only for this one sheet for this one workbook.
In looking for the problem, I've tried different versions of the code,
like this:
HoursFile.Sheets("Hours Act").UsedRange.Select
HoursFile.Sheets("Hours Act").UsedRange.Value = 1

These work fine also ... can anybody help to fix this issue for me?

Thanks, ray
 
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
Inconsistent Formula? andrew Excel Discussion (Misc queries) 6 February 12th 09 05:04 AM
Inconsistent Sort [email protected] Excel Programming 2 June 21st 07 08:37 PM
Inconsistent Sorting Saxman Excel Discussion (Misc queries) 17 October 23rd 06 11:17 AM
3-d referencing inconsistent duncan79 Excel Discussion (Misc queries) 5 January 25th 06 05:39 PM
Inconsistent code Stuart[_5_] Excel Programming 2 August 25th 03 07:32 PM


All times are GMT +1. The time now is 11: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"