Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

finding cell given row

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Finding a cell in a given row

Finding a cell in a given row

ResolvedVersion 2010

Steve has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course

Finding a cell in a given row

Can anyone tell me how to select a cell in a given column but on the currently active row, no matter where the active cell is? We are trying to run a dialogue box if the contents of the cell in a particular column are blank, but the user may begin from any point in the row.

I assume we need to move the active cell to column A from wherever it happens to be, then to offset to the column we need, but I'm not sure how to move to column A without knowing where the active cell is to begin with.

Hope that's clear!

Steve

RE: Finding a cell in a given row

Hi Steve

Thanks for getting in touch. You could do this a number of ways, but let's pursue your direction above. How do we get to column A? Assuming there are no blank cells to the left of the ActiveCell:

ActiveCell.End(xlToLeft).Offset(0, 1).Select

Will jump to the left of the data (I assume that's column A), then offset by 1 column. So the cursor will end up in column B. You can change the 1 for whichever column you need.

The xlToLeft instruction is like when you press CTRL left arrow on the keyboard. You can also do xlToRight, xlUp and xlDown.

Kind regards

Gary Fenn
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Finding a cell in a given row

Many thanks Gary. We do have column A blank, but that's no problem as we will always then end up in column B, and can offset appropriately from there.

Thanks again

Steve

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Concatenating Results of Formulas

To concatenate the results of formulas simply add the "&" after the formula or function closing bracket.

function1(....)&function2(.....)

see example Creating a range of monthly payments as text.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.