Solved

simple VBA question

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

Expert Comment

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

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 47

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

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.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

736 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