View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Formatting columns of unknown length

Hi Jock,

Try this as worksheet code

Sub stance()
lastrowA = Range("A65536").End(xlUp).Row
lastrowB = Range("B65536").End(xlUp).Row
lastrowF = Range("F65536").End(xlUp).Row

Set Range1 = Range("A1:A" & lastrowA)
Set Range2 = Range("B1:B" & lastrowB)
Set Range3 = Range("F1:F" & lastrowF)

Set range4 = Union(Range1, Range2, Range3)
For Each c In range4
c.Value = UCase(c.Value)
Next
End Sub

Mike

"Jock" wrote:

Hi,
I wish to format certain columns (say A, B, F) to uppercase, but I don't
know how long the columns will become.
Is there a 'catch all' paramer rather than stating the range?
tia
--
Traa Dy Liooar

Jock