new user - Need help

gapa

New Member
Joined
Jul 3, 2007
Messages
10
Hi,

I am a new user to Excel VBA.

Basically I want to perform a loop that searched values in a Row.

Normally, if it is in a column, this is what I would do

========

aaa=2

Do until Range("A"& aaa)="Something"
aaa=aaa+1
loop

========


How would i change this to look thru the rows ?

Thanks

Paul
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Perhaps you can be more specific as to what you want to do. The example you have posted will look through rows as you have asked until it finds a particular value and then stops without doing anything else :unsure:
 
Upvote 0
Code:
Private Sub CommandButton1_Click()
aaa = 2

Do Until Range("A1").Offset(0, aaa) = "X"
aaa = aaa + 1
Loop
End Sub
 
Upvote 0
hi,

Acutally, I want it to look thru the range heading of a pivot table, almost similar to a hlookup function. I need to know the column number so that I can make refers to it.

Hope this is clearer. But i guess the "offset" will works just as well

thanks
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,605
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top