« first day (443 days earlier)      last day (375 days later) » 

08:04
Woo, Happy weekend to all [T]/
 
1 hour later…
09:20
This week has gone way too fast
09:39
Macro man!
Don't suppose you could whip up another excel bit for me like before?
Pretty similar.
oh and half day today. I'm off at 1pm :D
I can't remember what I did lol
try me
one momento, should be simple.
I'll send you the old one first.
OLD:

Function SurnameTrim(inputText As String) As String

With CreateObject("VBScript.RegExp")
.Global = True
.IgnoreCase = True
.MultiLine = False
.Pattern = "[^ ]+ and .*"

If .Test(inputText) Then
SurnameTrim = .Execute(inputText)(0)
Else
SurnameTrim = inputText
End If
End With
End Function
"uno momento" ;)
No worries mate, no rush anyway, i really apreciate the help.
Don't get to do much vba where i work now so have already forgot everythingt i started to learn a few months ago lol.
Here is an example of some of le data:

Ms Louise Warren and Mr Graham Warren
Ms Lynne Parlato And Mr Roy Wilson

Need to paste this into one column then have the next column pull the first person mentioned initials out.

So in this case would be
LW
LP
10:08
Function GetInitialsFromFirstPerson(ByVal names As String) As String

    Dim firstPerson As String
    Dim namesOnly   As String
    Dim initials    As String

    firstPerson = Trim$(Split(LCase$(names), "and")(0))
    namesOnly = Trim$(Replace$(firstPerson, Split(firstPerson, " ")(0), ""))
    For Each word In Split(namesOnly, " ")
        initials = initials & UCase$(Left$(word, 1))
    Next

    GetInitialsFromFirstPerson = initials

End Function
Sub TestFunc()

    Dim test1 As String
    Dim test2 As String

    test1 = "Ms Louise Warren and Mr Graham Warren"
    test2 = "Ms Lynne Parlato And Mr Roy Wilson"

    Debug.Print GetInitialsFromFirstPerson(test1) '// LW
    Debug.Print GetInitialsFromFirstPerson(test2) '// LP

End Sub
niiiiiice.
Much obliged.
10:34
np
If any of you are interested.. getting my motor remapped today..
210bhp.. going to be sweet lol.
 
2 hours later…
12:30
@Steve101 Nice - what have you got?
 
2 hours later…
14:21
Hallo
I have a question and need help
Hi, sure go ahead
How to make a flag in VBA? i tried a public variable but it's a constant so i can't change it later
i have 14 worksheets in a workbook where i'm trying to create a table in each worksheet but before that i wanna make sure that i deleted the old table
i need to create a new table every time i run the workbook because it's a dynamic table
as some columns might exist or not depending on Band workbooks i'm looping through!
i hope the idea is clear enough
14:46
Do you mean a boolean?
Just use Dim myPublicFlag As Boolean at the top of a module
As long as you declare it outside of a Sub or Function it will have a public scope

« first day (443 days earlier)      last day (375 days later) »