Looking for a Macro expert

joelanin

New Member
Joined
Jun 3, 2012
Messages
6
Any one here know anything about macros in excel?

Would really appreciate a heads up.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Quite a few members here are pretty handy with VBA.....what are you after ??
 
Upvote 0
Thanks for your reply.
here's my code.

ActiveWorkbook.SaveAs Filename:=myfilename
MsgBox ("File Saved.")

The above code works fine if the "myfilename" doent exists. When the filename already exists, a display allerts message pops up that says"filename exists. Do you want to replace it? if user clicks OK, the code works fine as is. But when the button NO or CANCEL is clicked, the program displays error message,,, end or debug..... I want to terminate the code when NO or CANCEL is selected, how is it done? thanks
 
Upvote 0
Thanks for your reply.
here's my code.

ActiveWorkbook.SaveAs Filename:=myfilename
MsgBox ("File Saved.")

The above code works fine if the "myfilename" doent exists. When the filename already exists, a display allerts message pops up that says"filename exists. Do you want to replace it? if user clicks OK, the code works fine as is. But when the button NO or CANCEL is clicked, the program displays error message,,, end or debug..... I want to terminate the code when NO or CANCEL is selected, how is it done? thanks
See duplicate post http://www.mrexcel.com/forum/showthread.php?t=639475
 
Upvote 0
Any one here know anything about macros in excel?

Very Smooth...:rolleyes:
I have seen everything here from nice API examples from Jafaar, to Rory's "Cool" reminders of quicker ways of changing PageSetup through old style 4.0 code, to stellar string operations from PGC01, and all sorts of incredible worksheet formula (do I even have to mention Aladin?), to incredibly patient explanations, to great donations of time and effort (Richard Schollar's HTML maker easily comes to mind), to Norie's wit, etc., etc..


Thank you :) I like your signature!

I'm not a VBA expert.

You help the forummember is you put you whole code.

It would also help if you would use code tags.

Thanks for your reply.
here's my code.

ActiveWorkbook.SaveAs Filename:=myfilename
MsgBox ("File Saved.")

The above code works fine if the "myfilename" doent exists. When the filename already exists, a display allerts message pops up that says"filename exists. Do you want to replace it? if user clicks OK, the code works fine as is. But when the button NO or CANCEL is clicked, the program displays error message,,, end or debug..... I want to terminate the code when NO or CANCEL is selected, how is it done? thanks

Presuming the code is fired by a user's choice (I pushed a button, clicked somewhere, used a shortcut key combo - something other than the PC "willed" it), or even if not, why not just check to see if the file already exists before the .SaveAs?

Mark
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top