[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Select entire row from any cell

Posted on 2013-02-06
5
Medium Priority
?
378 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

650 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