Solved

VBA - Find all instances of an arrow character

Posted on 2009-04-04
1
555 Views
Last Modified: 2012-05-06
Ok, so I have a document with all of the data stored in one column. It's being copied from another document and the hierarchy of the data is symbolized by a series of spaces and an arrow character. I can't seem to represent this arrow character in VB Editor. What is the easiest way of deleting the spaces and arrows that proceed the company names leaving the names in a sortable list.

                                          ’ Company 1
                                          ’ Company 1
                                   ’ Company 2
                                   ’ Company 2
                            ’ Company 3
                            ’ Company 3
0
Comment
Question by:ThePATMAN26
1 Comment
 
LVL 2

Accepted Solution

by:
TheSailor earned 500 total points
ID: 24068882
Find the first character that is NOT a space and start reading the name after the next space.
Somehow like this

string s="   * company 1"
integer startread
integer i=1
while i < length( line )
 if mid( s, i, 1)<>" " then
  startread = i+2
  i=999
 end
end
print mid( s, startread, 999)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question