select merged cells

  • Thread starter Thread starter Max Potters
  • Start date Start date
M

Max Potters

Hi ,

I'm trying to select merged cells ("B25:B28"). When I type in the following
code, sheet1.range("B25").select, VB gives an error. I tried selecting the
whole range as well, but no success. Hope someone knows how to do this.

Thanks in advance

Max
 
It should work perfectly. What error does VB give....?
If the error is: OBJECT REQUIRED, then the sheet name is not correct
otherwise it should work perfectly

- Manges
 
any of these should work. You can't select a range w/o going to the sheet
but you can use goto

Sub selectmerged()
'Sheet5.Select
'Range("f3").Select

'Application.Goto Sheets("Sheet5").Range("f3")
Application.Goto Sheet5.Range("f3")

End Sub
 
the sheet with code name sheet1 would also need to be the active sheet.

sheet1.Activate
Sheet1.Range("B25").MergeArea.Select

mergearea shouldn't be required, but makes your intent clearer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top