jotting down the blank row number

daveyc18

Well-known Member
Joined
Feb 11, 2013
Messages
709
Office Version
  1. 365
  2. 2010
sor right now i have a loop that shows a message box saying if there is a number in column K, but column Q is blank, it'll display the blank row number for the analyst to fill in the blank in column Q with the necessary info.

however, rather than having the analyst jot down the row number, i want the macro to put the row number in column AA and of course build on the list if there is more than one row where the condition is true (i.e., number is column K, but column Q is blank)
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Post the code you have, then no one will have to guess what your sheet name(s) etc. are and where the code is located. The row number might just be the value of your loop counter - but can't see it so don't know.
and of course build on the list
What list? If row number is going into AA then there is no more list? Whatever you're doing when you have the info, would it not be easier if you just filtered the list to the rows where cell(s) are blank?
If posting code, please enclose code in code tags (use vba button on posting toolbar) to maintain readability.
 
Upvote 0
Post the code you have, then no one will have to guess what your sheet name(s) etc. are and where the code is located. The row number might just be the value of your loop counter - but can't see it so don't know.

What list? If row number is going into AA then there is no more list? Whatever you're doing when you have the info, would it not be easier if you just filtered the list to the rows where cell(s) are blank?
If posting code, please enclose code in code tags (use vba button on posting toolbar) to maintain readability.

like row 43 meets that condition, then cell aa1 has "43"

if row 50 meets that condition, then cell aa2 has "50"

so now column AA has 2 rows of numbers ..that's what I meant by build on that list
 
Upvote 0
Gotcha.
I take it that each time you run the code it is OK if the list changes in any fashion; i.e. values in AA1 and AA2 might get replaced, or if no rows satisfy the requirement, those values would be removed.
 
Upvote 0
Gotcha.
I take it that each time you run the code it is OK if the list changes in any fashion; i.e. values in AA1 and AA2 might get replaced, or if no rows satisfy the requirement, those values would be removed.

correct ...it's a monthly report with new data so the number of rows meeting those conditions (if at all) and the actual row numbers will vary
 
Upvote 0
You still haven't posted your VBA code (like Micron asked).
If you post it, we can probably build on to it to do what you want.
 
Upvote 0
You still haven't posted your VBA code (like Micron asked).
If you post it, we can probably build on to it to do what you want.
Code:
For c = 9 To finalrow
If Range("o" & c).DisplayFormat.Interior.Color = 65535 And Range("q" & c) = "" And Application.WorksheetFunction.IsNumber(Range("o" & c)) Then
MsgBox "There is a blank contact column on row " & Range("q" & c).Row
End If

so, essentially, whatever row number appears, put that row number in cell AA@. if another row meets that condition, put that in cell AA3, etc.
 
Upvote 0
Here is one way:
VBA Code:
    For c = 9 To finalrow
        If Range("O" & c).DisplayFormat.Interior.Color = 65535 And Range("Q" & c) = "" And Application.WorksheetFunction.IsNumber(Range("O" & c)) Then
            MsgBox "There is a blank contact column on row " & c
            r = r + 1
            Range("AA" & r).Value = c
        End If
    Next c

Note that "Range("q" & c).Row" can simply be replaced with "c".
No need to take the scenic round-about route back to where you started from!
 
Last edited:
Upvote 0
Maybe
VBA Code:
Dim i As Integer

For c = 9 To finalrow
  If Range("o" & c).DisplayFormat.Interior.Color = 65535 _
    And Range("q" & c) = "" _
    And Application.WorksheetFunction.IsNumber(Range("o" & c)) Then
      i = i + 1
      Range("AA" & i) = Range("q" & c).Row
    End If
Next
Adjust i if need to change start row.
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,050
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top