Hi,
A couple of things have come up today. I'm using Office 2003 and have set up a spreadsheet that needs users to input either a 'B' or 'S' in row H, and so I've set up a validated text box. I wanted to also put a little piece of code to change any manually input lower case 's' or 'b' to upper case, so I used:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'UPPER CASE
' Loop to cycle through each cell in the specified range.
For Each x In Range("H16:H1016")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.Value)
Next
This wasn't really what I wanted as the loop is too large. Can anyone tell me how I can best rewrite this range to just include the target cell? Though would I need to include the cell underneath in the range for when the data is entered (and the activecell drops to the next row)?
And I have a problem using F8 in the VBE, and also 'Step Into' from the menu. I can't get the debug to work, except by generating bad code, and so can't check if my code is working or not (unless it's bad). Has anyone come across this in Office 2003? I've trawled Google, so far to no avail.
Thanks for any help,
JW
A couple of things have come up today. I'm using Office 2003 and have set up a spreadsheet that needs users to input either a 'B' or 'S' in row H, and so I've set up a validated text box. I wanted to also put a little piece of code to change any manually input lower case 's' or 'b' to upper case, so I used:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'UPPER CASE
' Loop to cycle through each cell in the specified range.
For Each x In Range("H16:H1016")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.Value)
Next
This wasn't really what I wanted as the loop is too large. Can anyone tell me how I can best rewrite this range to just include the target cell? Though would I need to include the cell underneath in the range for when the data is entered (and the activecell drops to the next row)?
And I have a problem using F8 in the VBE, and also 'Step Into' from the menu. I can't get the debug to work, except by generating bad code, and so can't check if my code is working or not (unless it's bad). Has anyone come across this in Office 2003? I've trawled Google, so far to no avail.
Thanks for any help,
JW