LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 116
Default End if without Block If

I think I am trying to do too much in one line but I am not sure how to write
it correctly. I want the user to be able to click on cell P1 and then a
message box ask if they have completed the input - If yes, then save the file
name and date, if no then end sub. I am getting the error message above and
can't figure it out. Can anyone help?

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim ans As Long

If Target.Address = Range("p1").Address Then ans = MsgBox("Are you
finished inputing Daily Info?", vbYesNo)
If ans = vbNo Then ActiveWorkbook.SaveAs Filename:=Range("A1").Value &
Format(Worksheets("Daily").Range("ax1").Value, "yyyy-mm-dd") & ".xls"

End If
End Sub

Thanks
Carrie

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200805/1

 
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
mental block Lost in excel Excel Worksheet Functions 3 January 14th 07 08:18 PM
Average per block PP Excel Worksheet Functions 4 November 30th 06 07:22 PM
Block Protect RhysPieces Excel Discussion (Misc queries) 3 May 5th 06 06:32 PM
VBA error - End If without Block If Jane Excel Worksheet Functions 2 December 6th 05 06:00 PM
Block entries Boenerge Excel Worksheet Functions 2 May 5th 05 05:20 PM


All times are GMT +1. The time now is 11:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"