Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

simple VBA question

Posted on 2012-03-13
5
Medium Priority
?
444 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 41

Expert Comment

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

Accepted Solution

by:
Norie earned 2000 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 49

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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 will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

636 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