Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bogart Fischer   on Feb 09 In MS Office Category.

  
Question Answered By: Angel Watkins   on Feb 09

Never to old to learn, Charlie. Welcome to the wonderful, powerful world
of VBA.


I tackled what you want to do both in Excel, and in VBA. Before we get
to may answers, and lack thereof, let's discuss resources:

groups.google.com/advanced_group_search?q=group:*Excel*&num=100
is my other main resource apart from this group.
A lot of things you want to do will also be covered by
www.vba-programmer.com, e.g. determining last row  of data.
Another great resource is http://www.mvps.org/dmcritchie/excel/excel.htm
for many different reasons.

A great place  to start learning about VBA for Excel is
web.archive.org/.../default.
aspx?scid=/support/excel/content/vba101/default.asp. (See the ritchie
pages for more links).

------------------------------------------------------------------------
-----------------------------------------------------------------
My VBA code:

Option Explicit

Sub Extract_Text_Click()

' Define variables
Dim St1 As Variant
Dim i As Long
Dim Data_rows As Long

' Determine number of rows in user selected column  to loop through.
Data_rows = Range(Selection, Selection.End(xlDown)).Rows.Count

' Start looping through column A

For i = 1 To Data_rows

' Extract the text, and paste into column K using offset
function - Below not tested. Should be easy to make it work, though.
Range("K" & i).Value = Right(Range("A" & i), Find("location, ",
Range("A" & i), 2) + 20).Value

Next i

End Sub

Share: 

 

This Question has 11 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Extracting strings Or get search suggestion and latest updates.


Tagged: