FryGirl
Well-known Member
- Joined
- Nov 11, 2008
- Messages
- 1,368
- Office Version
- 365
- 2016
- Platform
- Windows
For the sake of learning a new technique in VBA, the code below works fine to replace certain numbers with text, but can it be converted into an array construct where it uses Lbound and Ubound? Is there a better method?
Code:
[FONT=arial]Sub ReplaceNumbers()[/FONT]
[FONT=arial] Dim c As Range[/FONT]
[FONT=arial] For Each c In Range("A2", Range("A" & Rows.Count).End(xlUp))[/FONT]
[FONT=arial] Select Case c.Value[/FONT]
[FONT=arial] Case 1[/FONT]
[FONT=arial] c.Value = "Working Project"[/FONT]
[FONT=arial] Case 2[/FONT]
[FONT=arial] c.Value = "Delayed Project"[/FONT]
[FONT=arial] Case 3[/FONT]
[FONT=arial] c.Value = "Completed Project"[/FONT]
[FONT=arial] End Select[/FONT]
[FONT=arial] Next c[/FONT]
[FONT=arial]End Sub[/FONT]