Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I want to prompt the user to enter a date from a message box, have the entry
be validated with pre-entered data in cells, and once verified, write the date to one cell. The pre-entered data is on worksheet "Index" in column G, rows 2-53. The data are all the Sunday dates in 2006 in mmm-dd-yy format. I want to write the result to worksheet "Global Setup" cell E5. The index sheet is normally hidden and password protected. Here is what I have so far: Dim wCtr As Long Dim iOffice As Integer, iDate As Date, iValue Dim password As String Application.ScreenUpdating = False Worksheets("Global Setup").Select Range("CA3").Select password = Range("CA3").Value ActiveSheet.Unprotect (password) Worksheets("index").Visible = xlSheetVisible Worksheets("Global Setup").Select Range("E5").Select iDate = CLng(Application.InputBox(prompt:="Enter the Date of the Next SUNDAY. (mm/dd/yy) Are you Ready?", Type:=1)) Msg = "Enter the Date of the Next SUNDAY. (mm/dd/yy) Are you Ready?" Ans = MsgBox(Msg, vbYesNo) If Ans = vbNo Then Exit Sub ' check iDate - Variance to matched row and column With wbSum.Sheets(2) Dim lastrow As Long, lastcol As Long, xV As Long, xR As Long, xC As Long lastrow = .Cells(Rows.Count, 1).End(xlUp).Row lastcol = .Cells(1, Columns.Count).End(xlToLeft).Column ' get matching column For xV = 1 To lastcol If iDate = .Cells(1, xV) Then xC = xV Next xV If xC = 0 Then MsgBox "Date: " & iDate & " not found in Date table" End With Worksheets("Global Setup").Select Range("E5").Select = iDate ActiveSheet.Protect (password) ' End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Help PLEASE! Not sure what answer is: Match? Index? Other? | Excel Worksheet Functions | |||
data entry using functions?????? | Excel Discussion (Misc queries) | |||
How can I make the graph omit blank cells in the data set? | Charts and Charting in Excel | |||
How do I copy data (word) into respective cells when the data bei. | New Users to Excel |