Creating a conditional formula

  • Thread starter Thread starter Mekre
  • Start date Start date
M

Mekre

I want to create a formula where, If any date is entered into a column, then
the number 1 comes up in another column. Whenever a project has an issued or
approved date entered, I need the value 1 to come up in another column, which
will be totalled and current at any given time.
 
The following code below will need to be applied to the sheet's code for
whichever sheet you want to watch for this date input.

Let me know if you need any help...

Mark Ivey


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Long

' This for loop will work for rows 1 to 300
' change it to suit your needs
For i = 1 To 300
' The following condition checks for each cell
' in column B to see if it has a date in it.
' Then it applies a 1 to the same row, but
' for columns out from its current position.
' Change it to suit your needs.
If IsDate(Cells(i, 2).Value) = True Then
Cells(i, 2).Offset(0, 4).Value = 1
End If
Next
End Sub
 
Mark,
I cannot get the formula right, sorry. I know this is wrong, but is this
close to how you write the formula?
=IFdate((C1),value)=true, then ((A1) value=1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top