?
Solved

Select entire row from any cell

Posted on 2013-02-06
5
Medium Priority
?
382 Views
Last Modified: 2013-02-06
Is the a piece of code that will enable me to select the entire row and copy that row from the cell I have landed on. i.e. My macro looks for a specific word, when it finds the word it selects the cell. Lets say I am on cell P32, can I then select the entire row 32?

I am using 2010

Thank you
0
Comment
Question by:Jagwarman
5 Comments
 
LVL 17

Expert Comment

by:wobbled
ID: 38858986
If you have selected the cell it is simply


ActiveCell.Row

eg

MsgBox "The row is " & ActiveCell.Row
0
 
LVL 17

Expert Comment

by:wobbled
ID: 38858990
and if you want to go on and select that row

Dim x As Long
x = ActiveCell.Row

Rows(x).Select
0
 
LVL 35

Accepted Solution

by:
Norie earned 2000 total points
ID: 38858993
You can select the entire row like this.
Rows(ActiveCell.Row).Select

Open in new window


And you can copy the row, without selecting, like this.
Rows(ActiveCell.Row).Copy

Open in new window

0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 38859161
or
activecell.entirerow.copy
0
 

Author Closing Comment

by:Jagwarman
ID: 38859273
brilliant
Thank you
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question