I cant seem to get this one. I am trying to interate two sections of code into one.
#1: Collects data and creates a range
Sub MinMax()
With Sheets("Sheet3") 'Loop thru Column A
Sh3LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set Sh3Range = .Range("A6:A" & Sh3LastRow)
End With
'Format data
For Each Sh3Cell In Sh3Range
If Sh3Cell.Offset(0, 13).Value <> "" Then
Sh3Cell.Offset(0, 4).Value = Sh3Cell.Offset(0, 12).Value & "-" & Sh3Cell.Offset(0, 13).Value
Sh3Cell.Offset(0, 12).Clear
Sh3Cell.Offset(0, 13).Clear
Else
Sh3Cell.Offset(0, 4).Value = Sh3Cell.Offset(0, 12).Value
Sh3Cell.Offset(0, 12).Clear
Sh3Cell.Offset(0, 13).Clear
End If
Next Sh3Cell
End Sub
#2: Find "comment" in a cell for column "E" only.
Sub FindComment()
With Sheets("Sheet3") 'Loop thru Column A
Sh3LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set Sh3Range = .Range("A6:A" & Sh3LastRow)
End With
For Each Sh3Cell In Sh3Range
Sh3Cell.Offset(0, 4).Activate
With ActiveCell
If .Comment Is Nothing Then
'Do code here
MsgBox "No Comment"
Else
'Do code here
MsgBox "Yes Comment"
End If
End With
Next Sh3Cell
End Sub
The goal is if "E6" through infinity has a comment I dont want to overwrite the contents of that cell.
Both examples of code run fine, its integrating them thats has me stumped.
As allways, help, tips and or hints are welcome.
Bookmarks