[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 449
  • Last Modified:

simple VBA question

If I have a2:c6 selected how do I reduce the selected area to b2:c6 using VBA?
0
BigWill5112
Asked:
BigWill5112
1 Solution
 
Kyle AbrahamsSenior .Net DeveloperCommented:
Range("b2:c6").Select
0
 
NorieVBA ExpertCommented:
There are various ways, here's one.
Selection.Resize(,Selection.Columns.Count-1).Offset(,1).Select

Open in new window

0
 
Martin LissOlder than dirtCommented:
Oops. Too late.
0
 
vb_elmarCommented:
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
 
BigWill5112Author Commented:
Exactly what I wanted.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now