Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Change Values to Something Else

I need a macro that looks for certain values on a sheet and changes them, for
example:

Change 1 to 1
Change 2 to 2
Change 11/2 to 1-1/2
Change 15/16 to 1-5/16
Change 113/16 to 1-13/16

Each of those values are in their own cell.

There are some cells that have phrases such as: 2 Pieces I dont want
that to get changed to 2 Pieces

Thank you,
Jeff Jensen
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Change Values to Something Else

Try this small macro:

Sub Jensen()
Dim oldd(10) As String
Dim neww(10) As String
dq = Chr(34)
oldd(0) = "1"
oldd(1) = "2"
oldd(2) = "11/2"
oldd(3) = "15/16"
oldd(4) = "113/16"
neww(0) = "1" & dq
neww(1) = "2" & dq
neww(2) = "1-1/2"
neww(3) = "1-5/16"
neww(4) = "1-13/16"
For Each r In ActiveSheet.UsedRange
v = r.Value
For i = 0 To 4
If v = oldd(i) Then
r.Value = neww(i)
End If
Next
Next
End Sub

--
Gary''s Student - gsnu200841


"Jeff Jensen" wrote:

I need a macro that looks for certain values on a sheet and changes them, for
example:

Change 1 to 1
Change 2 to 2
Change 11/2 to 1-1/2
Change 15/16 to 1-5/16
Change 113/16 to 1-13/16

Each of those values are in their own cell.

There are some cells that have phrases such as: 2 Pieces I dont want
that to get changed to 2 Pieces

Thank you,
Jeff Jensen

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Change Values to Something Else

Thank you Gary''s Student!

It works great and will save me so much time on a lot of projects! I may
even be able to do some fishing this summer!

Thanks again,

Jeff Jensen

"Gary''s Student" wrote:

Try this small macro:

Sub Jensen()
Dim oldd(10) As String
Dim neww(10) As String
dq = Chr(34)
oldd(0) = "1"
oldd(1) = "2"
oldd(2) = "11/2"
oldd(3) = "15/16"
oldd(4) = "113/16"
neww(0) = "1" & dq
neww(1) = "2" & dq
neww(2) = "1-1/2"
neww(3) = "1-5/16"
neww(4) = "1-13/16"
For Each r In ActiveSheet.UsedRange
v = r.Value
For i = 0 To 4
If v = oldd(i) Then
r.Value = neww(i)
End If
Next
Next
End Sub

--
Gary''s Student - gsnu200841


"Jeff Jensen" wrote:

I need a macro that looks for certain values on a sheet and changes them, for
example:

Change 1 to 1
Change 2 to 2
Change 11/2 to 1-1/2
Change 15/16 to 1-5/16
Change 113/16 to 1-13/16

Each of those values are in their own cell.

There are some cells that have phrases such as: 2 Pieces I dont want
that to get changed to 2 Pieces

Thank you,
Jeff Jensen

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Change Values to Something Else

Thank you for the feedback!
--
Gary''s Student - gsnu200841


"Jeff Jensen" wrote:

Thank you Gary''s Student!

It works great and will save me so much time on a lot of projects! I may
even be able to do some fishing this summer!

Thanks again,

Jeff Jensen

"Gary''s Student" wrote:

Try this small macro:

Sub Jensen()
Dim oldd(10) As String
Dim neww(10) As String
dq = Chr(34)
oldd(0) = "1"
oldd(1) = "2"
oldd(2) = "11/2"
oldd(3) = "15/16"
oldd(4) = "113/16"
neww(0) = "1" & dq
neww(1) = "2" & dq
neww(2) = "1-1/2"
neww(3) = "1-5/16"
neww(4) = "1-13/16"
For Each r In ActiveSheet.UsedRange
v = r.Value
For i = 0 To 4
If v = oldd(i) Then
r.Value = neww(i)
End If
Next
Next
End Sub

--
Gary''s Student - gsnu200841


"Jeff Jensen" wrote:

I need a macro that looks for certain values on a sheet and changes them, for
example:

Change 1 to 1
Change 2 to 2
Change 11/2 to 1-1/2
Change 15/16 to 1-5/16
Change 113/16 to 1-13/16

Each of those values are in their own cell.

There are some cells that have phrases such as: 2 Pieces I dont want
that to get changed to 2 Pieces

Thank you,
Jeff Jensen

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
How does one auto-change values? Darin Excel Worksheet Functions 1 June 15th 08 10:40 AM
Lookup and Change Values Jeff Gross Excel Worksheet Functions 3 March 20th 08 03:16 PM
Conditional formatting does not change when values change. ?? Texana Excel Worksheet Functions 4 August 20th 07 12:20 AM
How do I change a range of values from + to -? Dave6 Excel Discussion (Misc queries) 2 May 15th 06 01:48 PM
change values globally MIke Excel Worksheet Functions 4 November 16th 05 10:15 PM


All times are GMT +1. The time now is 08:19 AM.

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

About Us

"It's about Microsoft Excel"