Get_Involved
Active Member
- Joined
- Jan 26, 2007
- Messages
- 383
This Code works perfect when all the columns C28:I28 in the "Bid Calculator" have data in them.
When I keep, the columns filled together it also works with the other columns blank.
Sometimes I need to leave one of the columns blank, and fill the rest it doesn’t work.
Can someone fix the code in Row (13) to skip the blank, and work with the other columns also?
https://www.dropbox.com/s/exm1hp6jbdhsnki/Revew With Dropbox.xlsm?dl=0
When I keep, the columns filled together it also works with the other columns blank.
Sometimes I need to leave one of the columns blank, and fill the rest it doesn’t work.
Can someone fix the code in Row (13) to skip the blank, and work with the other columns also?
Code:
Private Sub Workbook_Open()
Dim Ans As String, cell As Range
Ans = MsgBox("Update Invoice Number (???)", vbYesNo + vbInformation)
If Ans = vbYes Then
For Each cell In Sheets("Legend").Range("E4:E18")
If cell.Value = Sheets("Bid Calculator").Range("C2").Value Then
Sheets("Legend").Cells(cell.Row, 5).Offset(, 12).Value = WorksheetFunction.Max(Sheets("Bid Calculator").Range("E5:E5")) + 1
Sheets("Legend").Cells(cell.Row, 5).Offset(, 13).Value = WorksheetFunction.Max(Sheets("Bid Calculator").Range("C28:I28")) + 1
Sheets("Legend").Range("S4:S18").Value = WorksheetFunction.Max(Sheets("Bid Calculator").Range("E7:E7")) + 1
Exit Sub
End If
Next cell
' Sheets("Legend").Cells(cell.Row, 5).Offset(, 12).Value = Sheets("Legend").Cells(cell.Row, 5).Offset(, 12).Value + 1
' Sheets("Legend").Cells(cell.Row, 5).Offset(, 13).Value = Sheets("Legend").Cells(cell.Row, 5).Offset(, 13).Value + 1
' Sheets("Legend").Cells(cell.Row, 5).Offset(, 14).Value = Sheets("Legend").Cells(cell.Row, 5).Offset(, 14).Value + 1
End If
End Sub
https://www.dropbox.com/s/exm1hp6jbdhsnki/Revew With Dropbox.xlsm?dl=0