Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Changing cell contents to various other values

Started 1 month, 1 week ago by wilmapayne
I'm working on a database query (I'm a RANK beginner!). I've managed to get the data into my spreadsheet. But I need to change values, depending on the value in the cell. Here's what it looks like: If the value from my database is 0, I need to get 006 into my spreadsheet. If the value from the db is 1 through 9, I need to multiply by 10 and show 10, 20, etc. in my spreadsheet - ...
Site: MrExcel Message Board  MrExcel Message Board - site profile
Forum: Excel Questions  Excel Questions - forum profile
Total authors: 2 authors
Total thread posts: 11 posts
Thread activity: no new posts during last week
Domain info for: mrexcel.com

Other posts in this thread:

ravishankar replied 1 month, 1 week ago
Hi paste the following codes in the macro window ( alt F11) and run the macro. Code: Sub wilma() Cells.NumberFormat = "@" For Each cell In ActiveSheet.UsedRange If cell.Value = 0 Then cell.Value = "006" ElseIf cell.Value > 0 And cell.Value < 10 Then cell.Value = "0" & cell.Value * 10 ElseIf cell.Value > 9 Then...

ravishankar replied 1 month, 1 week ago
Re: Changing cell contents to various other values Hi paste the following codes in the macro window ( alt F11) and run the macro. Code: Sub wilma() Cells.NumberFormat = "@" For Each cell In ActiveSheet.UsedRange If cell.Value = 0 Then cell.Value = "006" ElseIf cell.Value > 0 And cell....

wilmapayne replied 1 month, 1 week ago
Re: Changing cell contents to various other values Thank you, Ravi. I created the macro (first time I've ever done one of those, so it took me awhile!!). When I run it, I get a message that says "Run-time error '13': Type mismatch. When I click Debug, the code comes up with the last line before End If highlighted in yellow: cell...

ravishankar replied 1 month, 1 week ago
Re: Changing cell contents to various other values HI try these codes. It applies only to col D. Code: Sub wilma() Dim a As Long, x As Long x = Cells(Rows.Count, 1).End(xlUp).Row Range("D1:D" & x).NumberFormat = "@" For a = 2 To x If Cells(a, 4) = 0 Then Cells(a, 4) = "006" ElseIf Cells(a, 4) > ...

ravishankar replied 1 month, 1 week ago
HI try these codes. It applies only to col D. Code: Sub wilma() Dim a As Long, x As Long x = Cells(Rows.Count, 1).End(xlUp).Row Range("D1:D" & x).NumberFormat = "@" For a = 2 To x If Cells(a, 4) = 0 Then Cells(a, 4) = "006" ElseIf Cells(a, 4) > 0 And Cells(a, 4) < 10 Then Cells(a, 4) = "0" & Cells(a, 4) = Cells(a, 4) * 10 ElseIf ...

wilmapayne replied 1 month, 1 week ago
Hi - I'm sorry to keep bothering...this code works perfectly on the correct column, and returns the x10 result on all values greater than 9, but the first two options return a value of FALSE when I run the macro. Any suggestions?

wilmapayne replied 1 month, 1 week ago
Re: Changing cell contents to various other values Hi - I'm sorry to keep bothering...this code works perfectly on the correct column, and returns the x10 result on all values greater than 9, but the first two options return a value of FALSE when I run the macro. Any suggestions?

ravishankar replied 1 month, 1 week ago
Re: Changing cell contents to various other values Hi replace the line Cells(a, 4) = "0" & Cells(a, 4) = Cells(a, 4) * 10 with Cells(a, 4) = "0" & Cells(a, 4) * 10 Ravi

ravishankar replied 1 month, 1 week ago
Hi replace the line Cells(a, 4) = "0" & Cells(a, 4) = Cells(a, 4) * 10 with Cells(a, 4) = "0" & Cells(a, 4) * 10 Ravi

wilmapayne replied 1 month, 1 week ago
BEAUTIFUL! Thanks so much. I'll definitely be hanging around this message board - lots of stuff to learn.

 

Top contributing authors

Name
Posts
ravishankar
6
user's latest post:
Changing cell contents to...
Published (2009-11-13 05:46:00)
Re: Changing cell contents to various other values Hi replace the line Cells(a, 4) = "0" &amp; Cells(a, 4) = Cells(a, 4) * 10 with Cells(a, 4) = "0" &amp; Cells(a, 4) * 10 Ravi
wilmapayne
5
user's latest post:
Changing cell contents to...
Published (2009-11-13 16:55:00)
BEAUTIFUL! Thanks so much. I'll definitely be hanging around this message board - lots of stuff to learn.

Related threads on "MrExcel Message Board":

Related threads on other sites:

Thread profile page for "Changing cell contents to various other values" on http://www.mrexcel.com. This report page is a snippet summary view from a single thread "Changing cell contents to various other values", located on the Message Board at http://www.mrexcel.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity