I need some more clarification, in order of your posts above-
1.
Is there a way to code "Bid Calculator (C29:G29)" the number in the last cell before G29 example [c29 is 1, D29 is 2, E29 is 3], and F,G are blank.
Are you trying to find the max value in the range, to the left of cell G29. Are the numbers in the cells from C29 going to be increasing (as per your numbers 1,2,3 above) or can the largest number be in the first cell?
Are your figures like this
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Row 29[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]blank[/TD]
[TD]blank[/TD]
[TD]Answer= Range("E2").value=3[/TD]
[/TR]
</tbody>[/TABLE]
or is it more like this.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Row 29[/TD]
[TD]10[/TD]
[TD]15[/TD]
[TD]6[/TD]
[TD]8[/TD]
[TD]blank[/TD]
[TD]Answer= Range("D29").value=15[/TD]
[/TR]
</tbody>[/TABLE]
2. In the following code
Code:
Private Sub Workbook_Open()
Dim Ans As String
Ans = MsgBox("Update Invoice Number (???)", vbYesNo + vbInformation)
If Ans = vbYes Then
With Sheets("Legend").Range("Q4")
.Value = .Value + 1
End With
when someone clicks "yes" then the invoice number goes up by 1? Correct? Is the number being calculated in Range("R4") or Range("Q4")? You mentioned Range("R4") as an introduction to your code
Sheets("Legend").Range("R4") has this code,
but use Range("Q4") in your code?
3. This line of code is working OK?
Code:
Sheets("Legend").Range("Q4:Q18").Value = CInt(Format(Date, "ww", 1))
It is providing you with a number in each of the cells?
4.I am not sure why you are using the MAX function on only one cell?
Code:
Public Sub TestMe() Sheets("Bid calculator").Range("C2").Value = WorksheetFunction.Max(Range("Legend")"R4")) + 1
End Sub
5. your last piece of code does not make sense???
Code:
Public Sub TestMe()
If Range("C2") >= WorksheetFunction.Max(Range("C29:C29")) Then
End If
Range("C2") = WorksheetFunction.Max(Range("C29:C29")) + 1
End Sub
Your first line has a "equal to or greater than" statement while your 2nd line has an "equal to" statement.
Note: You seem to be changing your cells and ranges that you are working with, as you respond to my questions. To best help you we need to know exactly what you want. It may be best to rewrite your original question into as many smaller steps as possible. Remember we can't see your spreadsheets and we are very literal people.
cheers,
FS