LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Replacing a value in the string variable

I have the following numbers in range A1:J1
5 6 15 23 42 43 46 66 71 73

In my VBA code I have a sring variable strA which has a value "1, 2, 3,
4, 5"

I want to replace the value of strA with numbers in range A1:J10.

that means strA which was "1, 2, 3, 4, 5" earlier should become "5, 6,
15, 23, 42" that is cells(0,1).value, cells(0,2).value,
cells(0,3).value, cells(0,4).value, cells(0,5).value

similarly "3, 5, 6, 8, 10" should become "15, 42, 43, 66, 73" that is
cells(0,3).value, cells(0,5).value, cells(0,6).value, cells(0,8).value,
cells(0,10).value

I want a shortest code available, preferably a one liner although I am
not sure whether it is possible or not.

Thanks
Maxi

 
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
Replacing characters in cells string Billy B Excel Programming 1 June 27th 06 05:29 AM
Replacing a random string of 5 numbers Katie59 Excel Discussion (Misc queries) 5 March 23rd 06 09:12 PM
Replacing a string within a text file DHallam[_4_] Excel Programming 4 July 20th 05 06:00 AM
Formula for Replacing Text in a String? David Godinger Excel Programming 7 May 16th 05 02:05 PM
Replacing a value within a string using a formula solo_razor[_17_] Excel Programming 2 October 30th 03 09:46 AM


All times are GMT +1. The time now is 12:27 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"