TimeDivided
08-04-2015, 09:10 AM
Hi Folks,
I'm fairly new to VBA, and I'm trying to streamline a few processes at the office. I've perused the boards here (and the internet at large) for a while now and haven't found anything that quite solves what I am trying to do. I'd appreciate any insight at all, even if it's just a point in the right direction of where I should research further
I am sure there are some simple ways to do what I am trying to accomplish if I had the authority to edit the spreadsheet itself, but for reasons not worth getting into, I am unable to modify the layout of the excel sheet, and so am left the task of managing the insanity that I inherited (that never happens right?).
what I have is a travel schedule of sorts, with a non-normalized column in the spreadsheet that contains 3 or 4 different types of data (let's say town names, employee initials, and sometimes a time or other comments). This is part of a larger process I'm working on, but for now, what I want to do is find a way to get VBA to distinguish between the initials, and when the letters in those initials are part of a word. So for example Alex Cuelo's initials would be AC. I want to find all instances of "AC" in the column, but not "NYACK" or "ACTION" etc.
So im thinking something like:
If Activeworksheet.range("B1").value [code to describe "contains AC but only if it is not preceded by or followed by another letter or number"] Then
msgBox("Yes")
Else msgbox("No")
End If
Any help with exactly what code could solve the problem in the bracket would be greatly appreciated.
Thanks!
I'm fairly new to VBA, and I'm trying to streamline a few processes at the office. I've perused the boards here (and the internet at large) for a while now and haven't found anything that quite solves what I am trying to do. I'd appreciate any insight at all, even if it's just a point in the right direction of where I should research further
I am sure there are some simple ways to do what I am trying to accomplish if I had the authority to edit the spreadsheet itself, but for reasons not worth getting into, I am unable to modify the layout of the excel sheet, and so am left the task of managing the insanity that I inherited (that never happens right?).
what I have is a travel schedule of sorts, with a non-normalized column in the spreadsheet that contains 3 or 4 different types of data (let's say town names, employee initials, and sometimes a time or other comments). This is part of a larger process I'm working on, but for now, what I want to do is find a way to get VBA to distinguish between the initials, and when the letters in those initials are part of a word. So for example Alex Cuelo's initials would be AC. I want to find all instances of "AC" in the column, but not "NYACK" or "ACTION" etc.
So im thinking something like:
If Activeworksheet.range("B1").value [code to describe "contains AC but only if it is not preceded by or followed by another letter or number"] Then
msgBox("Yes")
Else msgbox("No")
End If
Any help with exactly what code could solve the problem in the bracket would be greatly appreciated.
Thanks!