ÿþ<HTML> <HEAD> <meta http-equiv="Content-Language" content="cs"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"> <title>VBA code</title> </HEAD> </P> <TABLE WIDTH="100%" ALIGN=CENTER CELLSPACING="0" BORDER="0"> <TR> <TD width="27%" align="LEFT" bordercolordark="#000000"><HR><P></TD> <TD ALIGN=CENTER>&nbsp;<P></TD> <TD ALIGN=CENTER>&nbsp;<P></TD> </TR> </TABLE> <style> <!-- a {text-decoration:none} a {color:RED} a {cursor: crosshair;} a:hover {color:WHITE} BODY { SCROLLBAR-FACE-COLOR:"#282828"; SCROLLBAR-HIGHLIGHT-COLOR:"SaddleBrown"; SCROLLBAR-SHADOW-COLOR:"LightSlateGray"; SCROLLBAR-3DLIGHT-COLOR:"LavenderBlush"; SCROLLBAR-ARROW-COLOR:"LightSlateGray"; SCROLLBAR-TRACK-COLOR:"LightSlateGray"; SCROLLBAR-DARKSHADOW-COLOR:"GRAY"; } --> </style> <body leftmargin="0" topmargin="0" marginwidth="0" marginheigt="0" link="BLACK" vlink="BLACK" alink="#C0C0C0" text="LavenderBlush"> <div align="left"> <body bgcolor="#111111"> <TABLE WIDTH="100%" ALIGN=CENTER CELLSPACING="0" BORDER="0"> <TR> <TD ALIGN="LEFT"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></b></p> </TD> <font face="Arial CE, Helvetica CE, Arial, Helvetica, sans-serif"> <TD ALIGN="LEFT"><b> <font color="LavenderBlush" style="font-size: 14pt">Do Loop, ScreenUpdating, If Then, Do While Not IsEmpty <p align="LEFT"><font color="LavenderBlush" style="font-size: 10pt"> <font face="Arial CE, Helvetica CE, Arial, Helvetica, sans-serif"> Sub Summary()<BR><BR> Dim strMonth As String<BR> Dim strHodnota_1 As String<BR> Dim strHodnota_2 As String<BR> Dim strHodnota_3 As String<BR> Dim sngHodnota_4 As Single<BR> Dim n As Integer<BR> Dim i As Integer<BR><BR> Application.ScreenUpdating = False<BR><BR> strMonth = Range("C6").Value<BR> &nbsp;&nbsp;&nbsp;&nbsp; Range("C9:F38").ClearContents<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Sheets("Evidence").Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Range("D55").Activate<BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Do While Not IsEmpty(ActiveCell)<BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; If strMonth = ActiveCell.Value Then<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, -1).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; strHodnota_1 = ActiveCell.Value<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, 2).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; strHodnota_2 = ActiveCell.Value<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, 1).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; strHodnota_3 = ActiveCell.Value<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, 1).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; sngHodnota_4 = ActiveCell.Value<BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Sheets("Summary").Activate<BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Range("C" & 9 + i).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Value = strHodnota_1<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, 1).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Value = strHodnota_2<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, 1).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Value = strHodnota_3<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, 1).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Value = sngHodnota_4 <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Sheets("Evidence").Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Range("D" & 55 + n).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; i = i + 1<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; End If<BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(1, 0).Activate<BR> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; n = n + 1<BR> &nbsp;&nbsp;&nbsp;&nbsp; Loop<BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Sheets("Summary").Select<BR><BR> Application.ScreenUpdating = True<BR><BR> End Sub </FONT></b></p></TD> <BR><P> </TD> <TD ALIGN="LEFT"><b> <p align="LEFT"><font color="LavenderBlush" style="font-size: 14pt"> </FONT> <p align="LEFT"><font color="LavenderBlush" style="font-size: 10pt"> <BR> <BR><P> <BR><P> <BR><P> <BR><P> </TD> </TR> </TABLE> <p align="RIGHT">Main &nbsp; <a href="http://tf.czu.cz/~ales/vba">+</a>&nbsp; &nbsp; &nbsp; &nbsp; <p align="RIGHT"><font color="SILVER" style="font-size: 8pt"> 2007 &nbsp; &nbsp; </BODY> </HTML>