J
JCO
Is it hard to change an existing macro from a hardcode selection so that the
macro works over an area that you selected with the mouse? Lets take
something easy like changing the Case to Proper Case (first letter of each
word is capitalized and all other letters are lowercase).
Sub ProperCase()
'Loop to cycle through each cell in the specified range.
For Each x In Range("C1:C5")
'There is not a Proper function in Visual Basic for Applications.
'So, you must use the worksheet function in the following form:
x.Value = Application.Proper(x.Value)
Next
End Sub
In this case, it is hardcoded for the range C1 to C5. I would like to Drag
and Select any area then run the Macro.
Is this possible?
Thanks
macro works over an area that you selected with the mouse? Lets take
something easy like changing the Case to Proper Case (first letter of each
word is capitalized and all other letters are lowercase).
Sub ProperCase()
'Loop to cycle through each cell in the specified range.
For Each x In Range("C1:C5")
'There is not a Proper function in Visual Basic for Applications.
'So, you must use the worksheet function in the following form:
x.Value = Application.Proper(x.Value)
Next
End Sub
In this case, it is hardcoded for the range C1 to C5. I would like to Drag
and Select any area then run the Macro.
Is this possible?
Thanks