Make code more economical
Hi Frank,
Thanks for the quick response. The program does not error in any
particular place. The code runs through OK for about 8 to12 loops then I get
an error in Excel saying - " General Protection Fault in Module KRNL386". I
presumed it to be poor programming and was looking for some suggestions. I
think you may have answered my question with that. I will review the code
and see.
Many Thanks for you help Mark
"Frank Kabel" wrote in message
...
Hi Mark
first I asked for the relevant part :-) So you may indicate where your
code does not work.
Some general points: You use Select + Activate + Activecell. You should
get rid of this (will slow down your code, etc.). e.g. the first
sttements could be written as follows:
Public Sub Format_Sheet()
'################################################# ##############
'Program to transfer and format plannings
'10 Sept 04
'#######################################
Dim strDetailL(16) As String
Dim strDetailR() As String
Dim strDetailBR() As String
Dim strToolDetail() As String
Dim strStartPoint As String
Dim strStartPointDetail As String
Dim counter As Integer
With ActiveSheet
'Collect Left Detail data
strDetailL = .Range("C2:C17").Value
'Collect Right Detail Data
ReDim strDetailR(0)
strDetailR(0) = .Range("F2").Value
counter = 3
Do While .Cells(counter, 1).Value < "5"
ReDim Preserve strDetailR(UBound(strDetailR) + 1)
strDetailR(UBound(strDetailR)) = .Cells(counter, 1).Value
counter = counter + 1
Loop
strStartPoint = .Cells(counter, 5).Address
End With
....
--
Regards
Frank Kabel
Frankfurt, Germany
"Mark C" schrieb im Newsbeitrag
...
|