Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Save_As()
set r = Range("A1:C1") set r1 = Range("A1,B1,D1") if application.CountA(r) < 3 or _ application.CountA(r1) < 3 then Msgbox "Populate Required Fields", vbOK exit sub End if Dim objShell As Object Dim objFolder As Object Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(&H5&) Application.Dialogs(xlDialogSaveAs).Show _ objFolder.Self.Path & "\" & Range("f1").Value & ".xls" End Sub -- Regards, Tom Ogilvy I need for the macro to verify either the group of cells A1, B1, C1 OR the group of cells A1, B1, D1 "el zorro" wrote: I have the ff macro which works great and saves the spreadsheet, but I need an additional verfication before the macro is run: Sub Save_As() Dim objShell As Object Dim objFolder As Object Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(&H5&) Application.Dialogs(xlDialogSaveAs).Show _ objFolder.Self.Path & "\" & Range("f1").Value & ".xls" End Sub I need for the macro to verify either the group of cells A1, B1, C1 OR the group of cells A1, B1, D1 be populated before the above macro is allowed to run. If neither of the two criteria are TRUE, then an error message window comes up to say "Populate Required Fields" then give the user an option to Cancel or Retry the operation. Thanks much. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cell verification | Excel Discussion (Misc queries) | |||
General Cell Data Verification and Copy... | Excel Discussion (Misc queries) | |||
data verification | Excel Discussion (Misc queries) | |||
How's this verification done? | Excel Programming | |||
Name Verification | Excel Programming |