Solved

range xldown &xright

Posted on 1998-12-03
2
926 Views
Last Modified: 2006-11-17
How Do I Select A Section Spaning Both Rows And Colunms
Use Macro's
Bad Code:
Sub Macro10()
    Range(ActiveCell, ActiveCell.End(xlDown)).Select
    Range(ActiveCell, ActiveCell.End(xlToRight)).Select
End Sub
0
Comment
Question by:refr
[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
2 Comments
 
LVL 3

Accepted Solution

by:
frazer earned 150 total points
ID: 1614817
Hi,

There are two ways to do this....

The first is....

Sub test()
    Dim Col As Range
    Set Col = Range("A1").End(xlToRight)
    Range("A1", Col.End(xlDown)).Select
End Sub

The other is....

Sub test2()
    Range("B2", Range("B2").SpecialCells(xlCellTypeLastCell)).Select
End Sub

This selects the last cell that has ever been used in the sheet rather than the last currently filled cell.

Hope this helps

Frazer
0
 

Author Comment

by:refr
ID: 1614818
Thank YOu Frazer For Your Double Answer And Promtness.
Well Done.
refr
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
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 …
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

734 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