View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Finding column of a particular cell

Dim ans as String, num as Long
Dim res as Variant
ans = Inputbox("Enter 6 digit number")
if isnumeric(ans) and len(trim(ans)) = 6 then
num = clng(ans)
res = application.Match(num, range("A1:E1"),0)
if not iserror(res) then
col = range("A1")(1, res).Column
else
msgbox "Not found"
end if
End if

--
Regards,
Tom Ogilvy

"Prema" wrote in message
...
I have the following data in columns A to E:
414816 414251 420374 420101 420121

user will be requested to enter the desired 6 digit number and I would

like
to establish the related column to use for updating certain cells in that
column.

Can anyone give me codes to achieve this?

Thank you
Prema