LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default change the 8th column in a not contiguous array

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP & non-contiguous table array Ruchi A.[_2_] Excel Worksheet Functions 3 August 19th 08 03:30 AM
Finding the longest contiguous 1-d array of 0's MJW[_2_] Excel Discussion (Misc queries) 2 November 30th 07 11:25 PM
summing non-contiguous array cells WRC Excel Worksheet Functions 10 November 5th 07 10:26 PM
Multiplying Contiguous Values in an Array [email protected] Excel Worksheet Functions 1 May 26th 07 06:46 AM
Creating an array from non-contiguous ranges David Excel Programming 1 September 16th 03 02:00 PM


All times are GMT +1. The time now is 11:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"