View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default extract numbers from text string

On Sun, 16 Dec 2007 21:51:00 -0800, thomsonpa
wrote:

Thanks very much Ron,

works exactly as I wanted. I used the call function to get it to run when I
wanted.


You're welcome. Glad to help. Thanks for the feedback.


I haven't tried yet, but is it possible to set the destination to another
worksheet?


You should be able to specify the worksheet in the Set Dest statement. e.g:

Set Dest = Worksheets("Sheet2").Range("A1:F100") 'your destination range


So far as writing to the destination range, it is only the cell in the upper
left corner that is critical:

e.g. Set Dest = Worksheets("Sheet2").Range("A1") 'your destination range

would write to the same range as above.

However, before I write to that area, I also like to clear the Destination
Range; so for that, several columns are required as above -- just make sure
it's large enough to encompass all your data.

This is very helpful if you run the routine more than once, to clear out the
old data. Depending on your source, you may need more than six columns.
--ron