Thread: Using Array's
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick S. Rick S. is offline
external usenet poster
 
Posts: 213
Default Using Array's

Hence my request for help?
This code was provided by other members and I am attempting to learn from
it. It is used in another module and functions properly, in this module I am
trying to use it to delete rows after the user makes selections. I have
found that deleting rows during selection throws off the counting during
selection and will omit rows from deletion.

The originating array code is as below, creating an array of selected sheets.
'======
Sub CopySelectSheets()

Dim N As Long
Dim ShtArray() As Variant
Dim Wks As Worksheet

For Each Wks In Worksheets
If Wks.Name < "ListA" Then
If Wks.Cells(4, "D").Value = 10 Then
N = N + 1
ReDim Preserve ShtArray(1 to N)
ShtArray(N) = Wks.Name
End If
End If
Next Wks

If N 0 Then
Sheets(ShtArray()).Copy After:=Sheets(ShtArray(N))
End If

End Sub
'======

The "goto" code scrolls to the cell that has a match.
'======
Application.Goto Reference:=Worksheets("Sheet1").Range(sh1cell.Addr ess), _
Scroll:=True
'======
Above is one string.
--
Regards

VBA.Newb.Confused
XP Pro
Office 2007