Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have this code, that selects a range which may be contiguous, or not
depending on what you select in the listbox. Private Sub OKButton_Click() Dim RowRange As Range Dim Rng As Range Dim RowCnt As Integer Dim r As Integer RowCnt = 0 For r = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(r) Then RowCnt = RowCnt + 1 If RowCnt = 1 Then Set RowRange = Range("MyRange").Rows(r + 1) Else Set RowRange = Union(RowRange, Range("MyRange").Rows(r + 1)) End If End If Next r If Not RowRange Is Nothing Then RowRange.Select Unload Me End Sub what can i add to it to make it change the 8th column to the value "A" in the selected ranges only? TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLOOKUP & non-contiguous table array | Excel Worksheet Functions | |||
Finding the longest contiguous 1-d array of 0's | Excel Discussion (Misc queries) | |||
summing non-contiguous array cells | Excel Worksheet Functions | |||
Multiplying Contiguous Values in an Array | Excel Worksheet Functions | |||
Creating an array from non-contiguous ranges | Excel Programming |