Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Commenting on Code


Hi all,

I asked for help regrading some work and very kindly i was provided
solution. Although i am very grateful i need to extend the ananlysi
but i have no idea what the 2 modules below do. Can somebody pleas
explain (very briefly) what each section does?

I would really appreciate the help!!

Many thanks,
Carl

1-
Code
-------------------
Sub mmm()
zonecode = Worksheets("sheet1").Range("a65536").End(xlUp).Row
etypes = Worksheets("sheet1").Range("iv1").End(xlToLeft).Co lumn
nextline = 2
For i = 2 To zonecodes
zcode = Worksheets("sheet1").Cells(i, 1).Value
For j = 2 To etypes
etype = Worksheets("sheet1").Cells(1, j).Value
enbr = Worksheets("sheet1").Cells(i, j).Value
Worksheets("sheet2").Cells(nextline, 1).Value = zcode
Worksheets("sheet2").Cells(nextline, 2).Value = etype
Worksheets("sheet2").Cells(nextline, 3).Value = enbr
nextline = nextline + 1
Next j
Next i
End Sub

-------------------


2 -

Code
-------------------
Sub HighTypes()
Dim LastRow As Long, lRow As Long
Dim ws2 As Worksheet, ws3 As Worksheet
Dim Top As Long, ws3row As Long
Dim ZoneStr As String
Dim ans As Integer
Dim rngHigh As Range

Set ws3 = Worksheets("sheet3")
With ws3
.Activate
.Range("A2:C" & .Range("C2").End(xlDown).Row).ClearContents
ws3row = 2
End With

Set ws2 = Worksheets("sheet2")
With ws2
LastRow = .Range("A2").End(xlDown).Row
lRow = 2
Do
Top = lRow
ZoneStr = .Cells(Top, "A").Value
Do
lRow = lRow + 1
Loop While (ZoneStr = .Cells(lRow, "A"))

ans = Application.WorksheetFunction.Max(.Range("c" & Top & ":C" & lRow - 1))
Set rngHigh = .Range("c" & Top & ":C" & lRow - 1).Find(what:=ans)
If Not rngHigh Is Nothing Then
.Range("A" & rngHigh.Row & ":C" & rngHigh.Row).Copy ws3.Range("A" & ws3row)
ws3row = ws3row + 1
End If
Loop While (lRow < LastRow + 1)
End With

End Sub



-------------------

--
Carlthoma
-----------------------------------------------------------------------
Carlthomas's Profile: http://www.excelforum.com/member.php...fo&userid=3370
View this thread: http://www.excelforum.com/showthread.php?threadid=53790

Reply
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
Commenting out code Jeff Excel Discussion (Misc queries) 2 January 31st 07 07:18 PM
Commenting out Rows in VB MC82 Excel Discussion (Misc queries) 5 January 20th 06 11:36 PM
Better Excel commenting SteveT Excel Discussion (Misc queries) 1 August 16th 05 02:55 PM
Conditional Commenting M H Excel Programming 2 July 22nd 05 11:42 AM
Commenting in Code Paul Black Excel Programming 7 October 9th 04 08:18 PM


All times are GMT +1. The time now is 06:43 PM.

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

About Us

"It's about Microsoft Excel"