View Single Post
  #2 (permalink)  
Old 01-18-10, 08:31
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Hi,

To use VBA to modify cell contents, there needs to be some sort of logical pattern you can include.

In your examples, there isn't an obvious pattern (not obvious to me, at least).

For example:

In this case, the cell contains the text "data123-124" and it seems that you want to remove anything from the hyphen onwards.
Quote:
data123-124 should become data123
In this example it seems that the cell contains the text "data123 & 5020" and you want to remove anything from the first space onwards.
Quote:
data123 & 5020 should become data123
In this example, the cell seems to contain the text "data 123b" and you want to remove just the final character (ie. not from the first space).
Quote:
data 123b should become data 123
Please can you clarify a set of rules as to what should be removed? Is it that you want to remove any characters which follow the first complete number?
Please also clarify if this is a one-off event, or something that has to happen with regularity?

Hope that helps...
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote