Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing numbers to characters by using range values

Here. Try this. The way you had it set up, any cell with a value of
for example, exactly two, wouldn't be changed. If you have an
questions about what I did, please let me know. ALSO, I have no
tested this, but it works in theory... - Pikus

Dim grv As Long
Dim lrow As Long
Application.ScreenUpdating = False

With Worksheets("Horizon_Measurements")
lrow = .UsedRange.Row - 1 + .UsedRange.Rows.Count
For grv = 1 To lrow
If (Cells(grv, 19).Value) = 0 Then
.Cells(grv, 19).Value = "N"
ElseIf .Cells(grv, 19).Value 0 And .Cells(grv, 19).Value <= 2 Then
.Cells(grv, 19).Value = "C"
ElseIf .Cells(grv, 19).Value 2 And .Cells(grv, 19).Value <= 5 Then
.Cells(grv, 19).Value = "F"
ElseIf .Cells(grv, 19).Value 5 And .Cells(grv, 19).Value <= 15 Then
.Cells(grv, 19).Value = "C"
ElseIf .Cells(grv, 19).Value 15 And .Cells(grv, 19).Value <= 40 Then
.Cells(grv, 19).Value = "M"
ElseIf .Cells(grv, 19).Value 40 And .Cells(grv, 19).Value <= 90 Then
.Cells(grv, 19).Value = "A"
ElseIf .Cells(grv, 19).Value 90 Then
.Cells(grv, 19).Value = "D"
End If
Next grv
End With

Application.ScreenUpdating = Tru

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing numbers to characters by using range values

Thanks,pikus, the code is working, still needs some fine tuning, i
changes also the text in S1 to letter D and when I run it second tim
it will change all letters to letter D as well

But the main idea is working. I am wondering how big my macro will b
when finished all this business..

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing numbers to characters by using range values

That's funny... Just for kicks, try changing this:

For grv = 1 To lrow
If (Cells(grv, 19).Value) = 0 Then
...
ElseIf .Cells(grv, 19).Value 90 Then
.Cells(grv, 19).Value = "D"
End If
Next grv


to:

For grv = 1 To lrow
If IsNumeric(.Cells(grv, 19).Value) Then
If (.Cells(grv, 19).Value) = 0 Then
...
ElseIf .Cells(grv, 19).Value 90 Then
.Cells(grv, 19).Value = "D"
End If
End If
Next grv

Do you get what I'm going for?

- Piku

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average a changing range of values Richard New Users to Excel 2 October 2nd 09 08:31 AM
Changing numerical values based upper and lower range jrmcosmo Excel Discussion (Misc queries) 4 September 22nd 09 04:58 PM
Changing column headers from alphabetical characters to numbers? dylan Excel Discussion (Misc queries) 2 July 24th 08 04:27 PM
Filling in a table with changing range values bunky2000 Excel Discussion (Misc queries) 1 May 28th 08 12:04 PM
how to format only specific characters or numbers within each cellwithin a range of cells Colleen Excel Discussion (Misc queries) 4 September 12th 05 10:04 PM


All times are GMT +1. The time now is 07:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"