ÿþ<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">Select Case, Cells <p align="LEFT"><font color="LavenderBlush" style="font-size: 10pt"> <font face="Arial CE, Helvetica CE, Arial, Helvetica, sans-serif"> <BR><BR> Public Sub Dan_Z_Nemovitosti() <BR><BR> Dim dblSazbaA#, dblSazbaB#, dblSazbaC#, dblSazbaF#, dblSazbaG# <BR><BR> Dim dblKoeficientA#, dblKoeficientB#, dblKoeficientC#, dblKoeficientF#, dblKoeficientG# <BR><BR> Dim strKultura$, dblDan#, n% <BR><BR> Dim dblVymera As Variant <BR><BR> n = 26 <BR><BR> Range("K27:K10000").ClearContents <BR><BR> Range("I11").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblSazbaA = ActiveCell.Value <BR><BR> Range("I12").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblSazbaB = ActiveCell.Value <BR><BR> Range("I13").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblSazbaC = ActiveCell.Value <BR><BR> Range("I14").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblSazbaF = ActiveCell.Value <BR><BR> Range("I15").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblSazbaG = ActiveCell.Value <BR><BR> Range("J11").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblKoeficientA = ActiveCell.Value <BR><BR> Range("J12").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblKoeficientB = ActiveCell.Value <BR><BR> Range("J13").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblKoeficientC = ActiveCell.Value <BR><BR> Range("J14").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblKoeficientF = ActiveCell.Value <BR><BR> Range("J15").Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; dblKoeficientG = ActiveCell.Value <BR><BR> <BR><BR> Range("H27").Select <BR><BR> Do While Not IsEmpty(ActiveCell) <BR><BR> strKultura = ActiveCell.Value <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, 1).Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dblVymera = ActiveCell.Value <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Offset(0, 2).Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Select Case strKultura <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Case "" <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Sub <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Case "A" <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dblDan = dblVymera * dblSazbaA * dblKoeficientA <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Case "B" <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dblDan = dblVymera * dblSazbaB * dblKoeficientB <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Case "C" <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dblDan = dblVymera * dblSazbaC * dblKoeficientC <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Case "F" <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dblDan = dblVymera * dblSazbaF * dblKoeficientF <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; Case "G" <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dblDan = dblVymera * dblSazbaG * dblKoeficientG <BR><BR> End Select <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp; ActiveCell.Value = dblDan <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n = n + 1 <BR><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cells(n, 8).Select <BR><BR> Loop <BR><BR> Range("K26").Select <BR><BR> End Sub <BR><P> <BR><P> </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>