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: 1
Default A Macro to replace a string in a cell with a string from another cell???


Hi there,

I am trying to write a subroutine Macro that replaces the string "xx
in Column C with the value from the neighbouring Column D.

Column C Column D
-------------------------------- -----------
Overpayment of xx from July 2005 -228.18
Credit Note for xx from Jan 2003 -121.90
Write Off of xx from Oct 2002 -238.24
Overpayment of xx from June 2003 -33.88
Overpayment of xx from Dec 2004 -153.63
Write Off of xx from April 2001 -195.15


For instance, the first entry in Column C above should be:

"Overpayment of -228.18 from July 2005"

This shouldn't be very hard to do I know!

I've tried using the REPLACE() and Find() and search() methods bu
whenever I run the Macro it says "Subroutine or Function not defined".

I guess I need to start by finding the numerical position of the "xx
substring in the text contents of each cell (from column C) and the
use this info with the replace method or something?

I've scoured the web and there's surprisingly little sample code whic
shows how to replace strings with other strings using VBA!

I'd be very grateful for any help you guys can offer!!

Sea

--
Plica0
-----------------------------------------------------------------------
Plica05's Profile: http://www.excelforum.com/member.php...fo&userid=2631
View this thread: http://www.excelforum.com/showthread.php?threadid=39584

 
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
replace text string automatically in cell Stephen Excel Discussion (Misc queries) 3 July 1st 07 11:36 PM
Macro syntax to check string length in a cell El Bee Excel Discussion (Misc queries) 3 November 1st 06 09:13 PM
How do I replace last numeric string from a alphanumeric string? Christy Excel Discussion (Misc queries) 3 August 11th 06 12:17 AM
Replace null string with blank cell gjcase Excel Discussion (Misc queries) 2 August 9th 05 02:13 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


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

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"