I thougth I had this figured out.
Option Explicit
Sub MissingDims()
'Original code by Leith Ross 11.02.08
'Modified by Rick Stanich 09.03.09
'Reviews Column "E" for blank cells (unreported values), Gets values from adjacent cells _
and pastes to sheet4 Column J.
Dim Blanks As Range
Dim LastE As Range
Dim LastRow As Long
Dim rCell As Range
Dim s As String
Sheets("Sheet3").Activate
With Sheets("Sheet3")
Set LastE = Cells(Rows.Count, "E").End(xlUp)
End With
If Not IsEmpty(LastE) Then
LastRow = WorksheetFunction.Max(LastE.Row)
Set Blanks = Range("E6", Cells(LastRow, "E")).SpecialCells(xlCellTypeBlanks)
'MsgBox LastRow 'for testing
'Clear Cloum J on Sheet4, add header and format
Sheets("Sheet4").Range("J:J").Clear
Sheets("Sheet4").Range("J1").Value = "Missing Dims"
Sheets("Sheet4").Range("J:J").NumberFormat = "@"
For Each rCell In Blanks
Sheets("Sheet3").Activate
With rCell
'If rCell.Comment = "" Then 'New 12.16.10
'Create string
s = .Cells.Row & " $$ #" & .Cells(1, -3) & ", " & _
.Cells(1, -2) & ", " & .Cells(1, 0)
'End If 'New 12.16.10
End With
'paste data
Sheets("Sheet4").Activate
With Sheets("Sheet4")
.Cells(Rows.Count, "J") _
.End(xlUp).Offset(1).Resize(rCell.Rows.Count).Value = s
End With
Next rCell
End If
End Sub
I tried "If rCell.Comment = "" Then" but it is not acceptable and errors.
Run-time error '438':
Object doesnt support this property or method
If a cell has a comment I want to skip it and move on to the next cell.
Any tips hints or examples are appreciated.
Bookmarks