Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do until macro is not recognizing date data 1

Status
Not open for further replies.

RooSXL

Technical User
Sep 22, 2004
22
US
I am trying to build a application in Excel to place an active reading into the months in order to later on only pick values that have an active forms. For some reason is not stoping at the cell carrying the date selected in the cell. The values in the cell is selected from a dropbox (data validation), is has the same format. I do not understand what could possibly be wrong. Please help.

Code:
Sub PlaceStatusOnMonths()
Dim StopDate As Date
StopDate = ActiveCell.Value
Range("B2:B61").ClearContents
Cells(2, 1).Select
    
    Do Until ActiveCell.Value = "StopDate"
    If ActiveCell <> "StopDate" And ActiveCell <> "" Then
    ActiveCell.Offset(0, 1) = "Active"
    ActiveCell.Offset(1, 0).Range("A1").Select
    End If
    Loop

Range("D2").Select
End Sub
[\code]

Thanks,

RooSxl
 
Hi RooSXL,

Don't entirely follow, but checking the cell for [purple]"StopDate"[/purple] is looking for a text string, not the date the StopDate variabble contains.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 

Sorry, that was a bit cryptic - remove the quotes from around StopDate so that the variableis interpreted.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top