Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub sel_to_array()
- Dim arr As Variant
- Dim i
- Sheets("Ps").Activate
- Sheets("Ps").Range("C6").Select
- Range(Selection, Selection.End(xlDown)).Select
- 'arr = ActiveCell.CurrentRegion.Value
- arr = Selection
- For Each i In arr
- MsgBox i
- If Round(i, 0) = Round(proj_cbox.Value, 0) Then
- GoTo 1:
- End If
- Next i
- End Sub
- Sub sel_to_array()
- Dim arr As Range, rng As Range, cell As Range
- Dim lastRow As Long
- Sheets("Ps").Activate
- lastRow = Sheets("Ps").Range("C" & Rows.Count).End(xlUp).Row
- If lastRow <= 5 Then Exit Sub
- Set rng = Range("C6:C" & lastRow)
- For Each cell In rng
- If Round(cell.Value, 0) = Round(proj_cbox.Value, 0) Then
- MsgBox cell.Address
- End If
- Next
- End Sub
- Sub sel_to_address()
- Dim MyRange As Range
- For Each MyRange In Range(Sheets("Ps").Range("C6"), Sheets("Ps").Range("C6").End(xlDown))
- MsgBox MyRange.Value
- If Round(MyRange.Value, 0) = Round(proj_cbox.Value, 0) Then
- MsgBox MyRange.Address
- End If
- Next MyRange
- End Sub
- MsgBox i.Address
- Set arr = Selection 'set here forces arr to a range object
- If Round(i, 0) = Round(proj_cbox.Value, 0) Then
- With i.Interior
- .Pattern = xlSolid
- .ColorIndex = 36 'Light Yellow
- End With
- Else
- i.Interior.ColorIndex = xlNone
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement