Excel 2010, I have this VBA routine that sets row heights on the basis of some parameters that begins like this;
Sub setHeights()
Dim targetRange As Range
Dim targetCell As Range
Set targetRange = Range("T18:T53")
For Each targetCell In targetRange.Cells
If Not IsEmpty(targetCell.Value) Then
If targetCell.Value = "Photo Comment: " Then
targetCell.RowHeight = 185 'and so forth
But instead of "Set targetRange = Range("T18:T53")" the range I really want would be something like "Set targetRange = Range (T8:T&counta(AD18:AD100)+15)"
In other words I want the range to be from T8 to T&(count the non empty cells in the range AD18:AD100 and add 15)
Can some one help me say that in VBA?
Sub setHeights()
Dim targetRange As Range
Dim targetCell As Range
Set targetRange = Range("T18:T53")
For Each targetCell In targetRange.Cells
If Not IsEmpty(targetCell.Value) Then
If targetCell.Value = "Photo Comment: " Then
targetCell.RowHeight = 185 'and so forth
But instead of "Set targetRange = Range("T18:T53")" the range I really want would be something like "Set targetRange = Range (T8:T&counta(AD18:AD100)+15)"
In other words I want the range to be from T8 to T&(count the non empty cells in the range AD18:AD100 and add 15)
Can some one help me say that in VBA?