ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   conditional if loop (https://www.excelbanter.com/excel-worksheet-functions/448704-conditional-if-loop.html)

ajay singh

conditional if loop
 
Hi all,
I have a bunch of lines programmed into the excel sheet. The code picks up the numbers from the cells and generates a pop-up message everytime a value is entered in the cells above them.

Each column contains one work week's data. The top row of the sheet contains the workweek number.

What I want to do is put two consecutive "if" condition for date verification.

If the data is entered in the column of the current workweek then it should run the above mentioned codes with some modification (I can handle the modification part).

If the data is entered in the column of any workweek later than current workweek then it should run the above mentioned codes in another configuration

Before it starts with the forecast section, it should verify the column in which the data is been entered against the current week and then choose accordingly.

This is how the code starts

Private Sub WorkSheet_Change(ByVal Target As Range)
Dim FP As Range
Dim FQ As Range
Dim FR As Range
Dim FS As Range
Dim ACP As Range
Dim ACQ As Range
Dim ACR As Range
Dim ACS As Range

' FOR FORCAST '''''''
Set FP = Range("E38:BI38")
If Not Application.Intersect(FP, Range(Target.Address)) _
Is Nothing Then
MsgBox "Please Order " & Target.Offset(24, -1).Value & " Quantity of Pump Systems by the End of Work Week " & Target.Offset(-2, -1).Value
End If




Thanks a lot for your help in advance.

Ajay


All times are GMT +1. The time now is 04:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com