ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message box in excel (https://www.excelbanter.com/excel-programming/349002-message-box-excel.html)

RANDY IN NC[_3_]

Message box in excel
 

Sorry on the last thread... site did not respond when I submited.

I am attempting to do the following... but I cannot figure out a coupl
of the steps..

1. I am making a copy of a worksheet from a workbook, starting a ne
workbook.. and doing a paste special values into the new workbook..
either need the new workbook to come up with just one sheet or I nee
to delete all blank sheets... when I have attempted this I get th
dialog box that says the deletion will be pementant. which I want it t
answer ok and go on... but how..

2. I need to do a save as to a new file name and want it t
automatically select the contents of a specific cell or combination o
cells for the file name to assign.. again how

3. I am saving it as a csv file.. but again I have dialog boxes I nee
it to get arround...

Thank you for your help!

Rand

--
RANDY IN N
-----------------------------------------------------------------------
RANDY IN NC's Profile: http://www.excelforum.com/member.php...fo&userid=2977
View this thread: http://www.excelforum.com/showthread.php?threadid=49624


Leith Ross[_430_]

Message box in excel
 

Hello Randy,

1.[/b] YOU CAN TURN OFF THE DIALOGS AND MESSAGES. EXCEL WILL USE TH
DEFAULT BUTTON AS THE RESPONSE AUTOMATICALLY. THIS WILL WORK IN TH
CASE OF DELETING THE WORKSHEETS.

*DISABLE DIALOG

Application.DisplayAlerts = False

ENABLE DIALOG
Re-enable it before you code finishes, so you will can see syste
messages.

Application.DisplayAlerts = True

[b]2.* Since you are working with 2 workbooks, it is a good practice t
fully qualify code procedures. ThisWorkbook always refers to th
workbook the code is written in. Change the Sheet name and Range t
what you will be using.

ThisWorkbook.Worksheets("Sheet1").Range("A1")

*3.* See question 1

Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49624


RANDY IN NC[_4_]

Message box in excel
 

Thank you I have been able to pass the dialog boxes... but I seem to b
having trouble with the name... I inserted the process for the nam
that you indicated but I am not doing something right..

Here is what the line from my macro looked like... before. but canno
change the name as you indicate.. Please let me know what I hav
wrong..

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Administrator\My Documents\contrac
work\jackson\AR1\order2.csv" _
, FileFormat:=xlCSV, CreateBackup:=False

I tried but get an error.."compile error expected end of statment"


Thank you.

--
RANDY IN N
-----------------------------------------------------------------------
RANDY IN NC's Profile: http://www.excelforum.com/member.php...fo&userid=2977
View this thread: http://www.excelforum.com/showthread.php?threadid=49624


Tom Ogilvy

Message box in excel
 
Dim sStr as String
sStr = ""C:\Documents and Settings\"
sStr = sStr & "Administrator\My Documents\contract "
sStr = sStr & "work\jackson\AR1\"
sStr = sStr & _
ActiveWorkbook.Worksheets(1) _
.Range("B1").Text
sStr = sStr & ".csv"
ActiveWorkbook.SaveAs _
Filename:=sStr, FileFormat:=xlCSV

Might solve your problem.
Adjust to fit your requirements.
--
Regards,
Tom Ogilvy



"RANDY IN NC"
wrote in message
...

Thank you I have been able to pass the dialog boxes... but I seem to be
having trouble with the name... I inserted the process for the name
that you indicated but I am not doing something right..

Here is what the line from my macro looked like... before. but cannot
change the name as you indicate.. Please let me know what I have
wrong..

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Administrator\My Documents\contract
work\jackson\AR1\order2.csv" _
, FileFormat:=xlCSV, CreateBackup:=False

I tried but get an error.."compile error expected end of statment"


Thank you..


--
RANDY IN NC
------------------------------------------------------------------------
RANDY IN NC's Profile:

http://www.excelforum.com/member.php...o&userid=29778
View this thread: http://www.excelforum.com/showthread...hreadid=496249





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com