Solved

simple VBA question

Posted on 2012-03-13
5
401 Views
Last Modified: 2012-03-13
If I have a2:c6 selected how do I reduce the selected area to b2:c6 using VBA?
0
Comment
Question by:BigWill5112
5 Comments
 
LVL 39

Expert Comment

by:Kyle Abrahams
ID: 37715348
Range("b2:c6").Select
0
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 37715377
There are various ways, here's one.
Selection.Resize(,Selection.Columns.Count-1).Offset(,1).Select

Open in new window

0
 
LVL 45

Expert Comment

by:Martin Liss
ID: 37715382
Oops. Too late.
0
 
LVL 17

Expert Comment

by:vb_elmar
ID: 37715394
Private Sub Command1_Click()
    On Error Resume Next
    Set o = GetObject(, "Excel.Application")
    o.Visible = True
    DoEvents
    o.ActiveSheet.Range("B2:C6").Select
End Sub
0
 

Author Closing Comment

by:BigWill5112
ID: 37715447
Exactly what I wanted.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 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

14 Experts available now in Live!

Get 1:1 Help Now