search worksheet
Assume our headers are in Row 1 of whichever sheet you need to search. You
can find which column they are in with
Dim sHdr as String, sh as Worksheet, rng as Range
Set sh = Worksheets("SheettoSearch")
sHdr = "LastName"
set rng = sh.Range("A1:IV1").Find(sHdr)
if not rng is nothing then
msgbox "Found at " & rng.Address(0,0,xlA1,True)
Else
msgbox sHdr & " Not found"
end if
--
regards,
Tom Ogilvy
"anderssweden" wrote:
I am making an automated reporting system for a bank. I copy information from
another program and insert it into excel. The information is columns with
headllines. Since the order of the info is somewhat different each time I
want to write a macro that identifies the headlines and places the
information in proper order. (I am a beginner in VisualBasic). Very thankful
for fast relpy!
--
banker
|