Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Problem changing numbers in a string

I have a string that contains something like the following.
a=10%b=1%c=19%d=06%e=18%f=20%
I need to change the numbers to new numbers contained on a Master sheet.

For example: if the new number in Master(3, 1) = "1" and the new number in
Master(3, 2) = "15". I want the string to now read a=1%b=15%, etc.

This new string then will be changed again with yet new numbers over and
over again as neded by the program

I hope I have made it clear. Can someone please help me with this


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Problem changing numbers in a string

You need to remove the old data from the sring. You didn't provide enough
info to be able to remove the old string. Here is how to build the new string

a = 1
b = 2
c = 3
d = 4
e = 5

MyStr = "a=" & a & "%b=" & b & "%c=" & c & "%d=" & d & "%e=" e & "%"


"HarryGuy" wrote:

I have a string that contains something like the following.
a=10%b=1%c=19%d=06%e=18%f=20%
I need to change the numbers to new numbers contained on a Master sheet.

For example: if the new number in Master(3, 1) = "1" and the new number in
Master(3, 2) = "15". I want the string to now read a=1%b=15%, etc.

This new string then will be changed again with yet new numbers over and
over again as neded by the program

I hope I have made it clear. Can someone please help me with this



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Problem changing numbers in a string

You didn't give much detail but you should be able to use this idea.

Sub changenumbers()
Application.ScreenUpdating = False
For Each c In Selection
v1 = "a=" & [h1] & "%"
v2 = "b=" & [h2] & "%"
v3 = "c=" & [h3] & "%"
v4 = "d=" & [h4] & "%"
v5 = "e=" & [h5] & "%"
For i = 1 To 5
c.Value = v1 & v2 & v3 & v4 & v5
Next i
Next c
Application.ScreenUpdating = True
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"HarryGuy" wrote in message
...
I have a string that contains something like the following.
a=10%b=1%c=19%d=06%e=18%f=20%
I need to change the numbers to new numbers contained on a Master sheet.

For example: if the new number in Master(3, 1) = "1" and the new number in
Master(3, 2) = "15". I want the string to now read a=1%b=15%, etc.

This new string then will be changed again with yet new numbers over and
over again as neded by the program

I hope I have made it clear. Can someone please help me with this



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Problem changing numbers in a string

For what you have shown us, this will create the string you want to a
variable named OutString which you can then use in any way you need to...

For X = 1 To UBound(Master, 2)
OutString = OutString & Chr(96 + X) & "=" & Master(3, X) & "%"
Next

--
Rick (MVP - Excel)


"HarryGuy" wrote in message
...
I have a string that contains something like the following.
a=10%b=1%c=19%d=06%e=18%f=20%
I need to change the numbers to new numbers contained on a Master sheet.

For example: if the new number in Master(3, 1) = "1" and the new number in
Master(3, 2) = "15". I want the string to now read a=1%b=15%, etc.

This new string then will be changed again with yet new numbers over and
over again as neded by the program

I hope I have made it clear. Can someone please help me with this





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Problem changing numbers in a string

Thanks very much to all who answered my call. I now have it working so on to
the next problem. Thanks again.


"HarryGuy" wrote in message
...
I have a string that contains something like the following.
a=10%b=1%c=19%d=06%e=18%f=20%
I need to change the numbers to new numbers contained on a Master sheet.

For example: if the new number in Master(3, 1) = "1" and the new number in
Master(3, 2) = "15". I want the string to now read a=1%b=15%, etc.

This new string then will be changed again with yet new numbers over and
over again as neded by the program

I hope I have made it clear. Can someone please help me with this




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
Changing A Column Of Text numbers To True Numbers: How ? Robert11[_3_] New Users to Excel 2 March 4th 09 09:08 PM
changing numbers in a text string in a new cell Xhawk57 Excel Discussion (Misc queries) 4 May 16th 07 06:22 PM
Changing column of numbers made of formulas to just numbers CJ Excel Discussion (Misc queries) 2 June 14th 06 02:13 PM
Converting String numbers into real numbers Werner[_11_] Excel Programming 1 June 27th 05 09:41 PM
Converting String numbers into real numbers Jean-Jérôme Doucet via OfficeKB.com Excel Programming 2 June 27th 05 03:30 PM


All times are GMT +1. The time now is 03:42 PM.

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"