Gerry:::::)
New Member
Hi,
I am having trouble with my macros as they only run for a small amount time, before falling over... reasons being the IT DB admins keep changing the system reports columns by adding (mostly adding extra )or deleting columns, I export these reports to CSV Excel file then run my macros to delete and manipulate not needed columns and data.
I need a way of amending my existing code to attempt to full proof this so as even if IT insert, move or remove columns (as they do with there patches/updates) my macro/s will still run without falling over.
So currently my macros does something similar to the following simple example
I am having trouble with my macros as they only run for a small amount time, before falling over... reasons being the IT DB admins keep changing the system reports columns by adding (mostly adding extra )or deleting columns, I export these reports to CSV Excel file then run my macros to delete and manipulate not needed columns and data.
I need a way of amending my existing code to attempt to full proof this so as even if IT insert, move or remove columns (as they do with there patches/updates) my macro/s will still run without falling over.
So currently my macros does something similar to the following simple example
Code:
' I really need a way to find the specific columns rather than the below if statement which just checks if the column contains the specific value I wish to manipulate.
If Range("O2").Value = "VIDEO" And Range("P2").Value = "EVENT" Then
Application.CutCopyMode = False
Columns("O:P").Select
Selection.Delete Shift:=xlToLeft
end if