Re: I was given this macro from this group

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jezebel (warcrimes_at_whitehouse.gov)
Date: 02/04/05


Date: Fri, 4 Feb 2005 18:00:28 +1100

The code is working on a piece of text. I don't know where the text is
coming from, so you'll need to put that in yourself. Presumably it's the
text of a paragraph ... but you can't expect the forum to write your entire
app for you. This is basic stuff well covered in help.

You declare variables with Dim statements. This too is very basic and well
explained in help as well as at the beginning of chapter 1 of any
programming guide you care to look at.

Trying to learn to program by trial and error is truly the slowest possible
way to go about it.

"Steved" <anonymous@discussions.microsoft.com> wrote in message
news:1d5d01c50a80$eb5bf0d0$a601280a@phx.gbl...
> Hello from Steved
>
> I am very new at this and have no idea about the
> terminology and subsequently i've now have no idea
> what to do with your kind answer. Please understand
> the reason I came to this sight is to get an answerto my
> issue, and the end result would be that it works. You are
> asking me to understand code which is new to me so please
> if you would bare with me please just show me how I can
> get your macro to function. In other words a) and b)I
> cannot comprehend.
>
> Thankyou.
>
>
>>-----Original Message-----
>>By now you should have learned enough about coding to
> actually read and
>>think about these code snippets. You can't just paste
> them into a module and
>>pray.
>>
>>a) Insert, in place of Range.Text, whatever string
> you're working with.
>>
>>b) Declare all the variables.
>>
>>
>>
>>
>>
>>"Steved" <anonymous@discussions.microsoft.com> wrote in
> message
>>news:03c101c50a79$d2c98570$a501280a@phx.gbl...
>>> Hello from Steved
>>>
>>> The below macro Keeps highlighting the belowand will
> not
>>> work please help.
>>>
>>> pWords = Split(Range.Text, " ")
>>>
>>>
>>> Sub Testing()
>>> Dim pWords() As String
>>> pWords = Split(Range.Text, " ")
>>> For i = 0 To UBound(pWords)
>>> If pWords(i) Like "[a-zA-Z]{1,}" Then
>>> pStartWord = i
>>> Exit For
>>> End If
>>> Next
>>>
>>> Output = pWords(pStartWord)
>>> For i = pStartWord + 1 To UBound(pWords)
>>> Output = Output & " " & pWords(i)
>>> Next
>>> End Sub
>>
>>
>>.
>>