Macro - select

P

puiuluipui

Hi, i need an macro to select all filled cells in range C10:K90.
Can this be done?
Thanks!!!
 
J

Jacob Skaria

Range("C10:K90").SpecialCells(xlCellTypeConstants, _
xlNumbers + xlTextValues).Select

If you want to select xlErrors and xlLogical add those to xlNumbers +
xlTextValues
 
P

puiuluipui

It's perfect!
Thanks!

"Jacob Skaria" a scris:
Range("C10:K90").SpecialCells(xlCellTypeConstants, _
xlNumbers + xlTextValues).Select

If you want to select xlErrors and xlLogical add those to xlNumbers +
xlTextValues
 
P

puiuluipui

Hi, i encountered a problem and i need the macro to select a square from the
first left cell to the last right cell and from the top cell to the bottom
cell.

Can this be done?
Thanks!

"Jacob Skaria" a scris:
 
J

Jacob Skaria

Try the below..

Dim strAddress As String, arrAddress As Variant
strAddress = Range("C10:K90").SpecialCells(xlCellTypeConstants, _
xlNumbers + xlTextValues).Address
arrAddress = Split(Replace(strAddress, ":", ","), ",")
Range(arrAddress(0), arrAddress(UBound(arrAddress))).Select
 

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

Top