Solved

simple VBA question

Posted on 2012-03-13
5
422 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 40

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 46

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

821 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