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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Lewiy

Well-known Member
Joined
Jan 5, 2007
Messages
4,284
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:
 

DiscoPistol

Active Member
Joined
Jun 6, 2006
Messages
261
Code:
Private Sub CommandButton1_Click()
aaa = 2

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

gapa

New Member
Joined
Jul 3, 2007
Messages
10
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
 

Forum statistics

Threads
1,181,720
Messages
5,931,668
Members
436,797
Latest member
fullmetalpogi

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
Top