Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another easy question

Status
Not open for further replies.

lekayra

MIS
Apr 1, 2003
4
FR
All I am trying to do is to select some specific cells. I can do this in two ways. Either by selecting BOLD cells. or by numbers (A1, A11, A21, A31...)

If possible could you explain how to do this properly.

Tnx in advance. And sorry for that basic question.

Lekayra.
 
Lekayra, try something like this
Range("B4,C7,F8,F3,D10").Select

(Look under "Referring to Cells and Ranges by Using A1 Notation" in VBA help for more information.)

If you wish to select cells where the formatting is set to bold, then you will need something like this

Sub SelectBold()
Dim Cll As Object
Dim CllAdd As String

For Each Cll In Worksheets("Sheet1").Range("A1:D10").Cells
If Cll.Font.Bold = True Then
CllAdd = CllAdd & Cll.Address & ", "
End If
Next
CllAdd = Left(CllAdd, Len(CllAdd) - 2)
Range(CllAdd).Select

End Sub


 
Are you merely trying to SELECT these cells, or to perform some operation on them? Rob
[flowerface]
 
I wanted to perform afew small task. And I was able to do it with your help. Thanx again.

Lekayra.

------------------------------------------
If a rat can enter, so can a Kender.
Ansalon Proverb.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top