lucpian
03-27-2008, 11:24 AM
Hello,
I am new to this forum and I am trying my luck because my colleague at work talks so good of how this forum is and has been very useful to him. I have a vba code which I am writing to change whatever entry to uppercase, but it should use an array. I am a complete novice as long as vba is concern. I did put up the following code, and it is not working . I want the code to check if the values is D or G, and if it is not an uppercase D or G it should color it blue. That is too much of a homework.
Function MainteFreq(columnname As Integer)
Dim rowcount
Dim R
rowcount = Range("A65536").End(xlUp).Row
For R = 2 To rowcount
strVal = Sheet1.Cells(R, columnname).Value
'Sheet1.Cells(R, columnname).Value = strVal
If strVal = "y" Or strVal = "m" Then
strVal = UCase(strVal)
End If
Next
End Function
Please, someone help me out.
Thanks
MariaFunsho
I am new to this forum and I am trying my luck because my colleague at work talks so good of how this forum is and has been very useful to him. I have a vba code which I am writing to change whatever entry to uppercase, but it should use an array. I am a complete novice as long as vba is concern. I did put up the following code, and it is not working . I want the code to check if the values is D or G, and if it is not an uppercase D or G it should color it blue. That is too much of a homework.
Function MainteFreq(columnname As Integer)
Dim rowcount
Dim R
rowcount = Range("A65536").End(xlUp).Row
For R = 2 To rowcount
strVal = Sheet1.Cells(R, columnname).Value
'Sheet1.Cells(R, columnname).Value = strVal
If strVal = "y" Or strVal = "m" Then
strVal = UCase(strVal)
End If
Next
End Function
Please, someone help me out.
Thanks
MariaFunsho