Solved

Select entire row from any cell

Posted on 2013-02-06
5
359 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
Comment Utility
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
Comment Utility
and if you want to go on and select that row

Dim x As Long
x = ActiveCell.Row

Rows(x).Select
0
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
Comment Utility
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
Comment Utility
or
activecell.entirerow.copy
0
 

Author Closing Comment

by:Jagwarman
Comment Utility
brilliant
Thank you
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now