LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Starting Auto_Close macro based on an IF statement

I'm over my head --
I run an auto_close macro to retrieve and save data collected during a user
session. The macro takes all rows with data, copies them to a folder, then
clears the collection sheet for next session.
If there is NO DATA collected, I want to end the macro right away.
Otherwise, I'm getting an error saying Excel can't move things off the
worksheet because data may be lost . . . to paraphrase I think it's a
runtime error 1004?

Here is what I came up w/, but not sure if it's even close -- it doesn't
work though.

If Sheets("Worksheet") & Range("A3") = "" Then
ActiveWorkbook.Save
ActiveWorkbook.Close
End If
Else
Workbooks.Open Filename:="W:\. . .

Where if A# < "", then I want to run the macro. Any help?

 
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
Starting A Macro zephyr Excel Discussion (Misc queries) 2 November 10th 06 12:03 PM
starting a macro at startup chip_pyp Excel Discussion (Misc queries) 1 March 22nd 06 06:59 PM
Starting a macro with the IF function THW Excel Worksheet Functions 4 June 19th 05 05:40 PM
How can I assign a range starting cell based on a variable locati. feman007 Excel Discussion (Misc queries) 1 March 9th 05 11:41 PM
How can I assign a range starting cell based on a variable locati. feman007 Excel Worksheet Functions 3 March 9th 05 11:40 PM


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