counting number of columns

J

john.9.williams

Hi,

i am using a find action to find a specific value in a multi column
list.

i can find the value no probs and can return the cell reference the
valueis in.

What i now need to do is use that cell in an offset statement.

i need to find out how many columns over from A1 that my find data is
in.

For instance if my find data was in column d, i would use the offset
number 4

any help greatly appreaciated
 
C

Claus Busch

Hi,

Am Fri, 10 May 2013 08:09:01 -0700 (PDT) schrieb
(e-mail address removed):
For instance if my find data was in column d, i would use the offset
number 4

try:

Sub mySearch()
Dim c As Range

With ActiveSheet
Set c = .UsedRange.Find(" my specific value", LookIn:=xlValues)
If Not c Is Nothing Then _
MsgBox c.Column
End With
End Sub


Regards
Claus Busch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top