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 VBA question

A co-worker, who has since moved on to greener pastures, coded the following
for me. I use it to explode the contents of partlists, where all the part
numbers of a particular type are stored in a cell. Now I am receiving the
lists from new sources, and need to update the code a bit, something I am
completely unfamiliar with.

In this statement If InStr(strNewNumber1, " ") 0 Then how would I also
include (TAB) and other pseudo space charecters, so it will work on files
produced by people who refuse to use the space bar?

Function Explode()

Dim strRow As String
Dim strNewNumber1 As String
Dim strNewNumber2 As String
Dim intPosition As Integer

strRow = 2

Do Until Range("B" & strRow).Value = ""

Range("B" & strRow).Select
strNewNumber1 = Trim(Range("B" & strRow).Value)
If InStr(strNewNumber1, " ") 0 Then

intPosition = InStr(strNewNumber1, " ")
strNewNumber2 = Left(strNewNumber1, intPosition - 1)
strNewNumber1 = Trim(Mid(strNewNumber1, intPosition))

Rows(strRow & ":" & strRow).Select
Selection.Copy
Rows(strRow + 1 & ":" & strRow + 1).Select
Selection.Insert Shift:=xlDown

Range("B" & strRow).Value = strNewNumber2
Range("B" & strRow + 1).Value = strNewNumber1

End If

strRow = strRow + 1

Loop


End Function
 
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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


All times are GMT +1. The time now is 10:22 AM.

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"