Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code is working in one file but not in another.


Hi Everyone!!
This is my desperate cry for help. I have been trying to correct a cod
for aorund a month. I have only removed repeated actions and reduce
the code size by half. But now the code is behaving very strangely.
have checked and rechecked.....but there is absolutely no error.
I have posted for different problems but everytime I have got
different solution but no answer why this code is wrong. So far no on
has said that code is wrong but they have given me alternate solutions
This doesn't lead me newhere for two reasons: I don't learn ab
programming 'coz I am not able to find the error. And then, thei
solution also doesn't work( sorry folks, but thats the way it is. I
might be working for U, but not on my PC). BTW I am using Excel 2000 o
win 2000, if U think that it might be a source of my woes( then why i
the same code working in other file?)
Now if anyone has time and the will, I simply want someone to compar
the codes and let me know WHERE and WHAT is the problem?
Thankyou so much for having the patience to read through,
Waiting for help desperately
Shilp

+----------------------------------------------------------------
| Attachment filename: code compare.doc
|Download attachment: http://www.mcse.ms/attachment.php?postid=1463457
+----------------------------------------------------------------

-
shilp
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message579280.htm

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code is working in one file but not in another.

Sorry - most of us do not download files.
You will probably need to copy/paste your code.
Bear in mind that the error may not be in the code itself but in th
availability of the ranges/sheets etc.

The biggest cause of error here is "lazy programming", wher
worksheets/ranges are not explicitly or fully coded eg :-

'--------------------------------------------------------------------------------
MyValue
Workbooks("Book1.xls").WorkSheets("Sheet1").Range( "A1").Value
'--------------------------------------------------------------------------------
where this would save a lot of typing :-
Dim MySheet as WorkSheet
Set MySheet = Workbooks("Book1.xls").WorkSheets("Sheet1")
'--------------------------------------------------------------------------------

As you progress in writing code, you should be using this metho
instead of "Select" unless you actually need to see something in
worksheet

--
Message posted from http://www.ExcelForum.com

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
VBA Code Not Working tictox Excel Discussion (Misc queries) 0 July 6th 10 06:40 PM
VB Code Is Not Working Rob Excel Discussion (Misc queries) 2 May 30th 07 05:23 PM
Vb Code not working bob Excel Programming 3 January 5th 04 01:29 PM
why this code not working Bernie Deitrick[_2_] Excel Programming 0 September 2nd 03 05:08 PM
For Each Code Not Working jacqui[_2_] Excel Programming 4 July 29th 03 02:44 AM


All times are GMT +1. The time now is 08:36 PM.

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"