UnitedCloud01
New Member
- Joined
- Nov 14, 2017
- Messages
- 30
- Office Version
- 365
- Platform
- Windows
Hi Everyone
I have a Macro that currently works well until I have to add extra rows into the sheet. When I do this, it necessitates me manually updating the cell range for the column as well as the destination cell for the data that will be retrieved from the column range.
The column has data in it that relates to names of patients that are due for a review. When I press on the button linked to the macro, this data is retrieved, and all the names are listed in the destination cell so clinicians can work through the list.
Ideally, I would like the range to be dynamic so it can accommodate rows being added. I would also like the destination cell to move with the additional rows and for the macro to accommodate this without manual amendments.
The below is the macro
Reminder for Today (Rem Today)
Sub ab_notsonull()
Dim X As String, cell As Range
For Each cell In Range("Z5:Z2100")
If (Len(cell.Value) > "*") Then
X = X & (cell.Value & "" & Chr(10))
End If
Next
Range("C2105").Value = Left$(X, Len(X) - 1)
Range("C2105").WrapText = True
End Sub
Thanks so much for assisting.
Scott
I have a Macro that currently works well until I have to add extra rows into the sheet. When I do this, it necessitates me manually updating the cell range for the column as well as the destination cell for the data that will be retrieved from the column range.
The column has data in it that relates to names of patients that are due for a review. When I press on the button linked to the macro, this data is retrieved, and all the names are listed in the destination cell so clinicians can work through the list.
Ideally, I would like the range to be dynamic so it can accommodate rows being added. I would also like the destination cell to move with the additional rows and for the macro to accommodate this without manual amendments.
The below is the macro
Reminder for Today (Rem Today)
Sub ab_notsonull()
Dim X As String, cell As Range
For Each cell In Range("Z5:Z2100")
If (Len(cell.Value) > "*") Then
X = X & (cell.Value & "" & Chr(10))
End If
Next
Range("C2105").Value = Left$(X, Len(X) - 1)
Range("C2105").WrapText = True
End Sub
Thanks so much for assisting.
Scott