Dear Mas Nang Agus,
Coba di tambahkan :Sheet1.Actvate sebelum code
Sheet1.Range("Q9:Q1000").ClearContents
TerimaKasih.
Pada Rabu, 15 Juni 2016 9:10, "Nang Agus [email protected]
[belajar-excel]" <[email protected]> menulis:
Mohon maaf ada ketidak cocokan antara tulisan di email dan di file, yang
benar penulisan VBAnya:
Sub Etung()
Dim kl As String
Dim i As Integer
Dim baris As Integer
Dim a As Integer
Dim it As Integer
Dim z As Integer
Dim itu As Integer
baris = Sheet1.Range("A10000").End(xlUp).row
z = 7
Sheet1.Range("Q9:Q1000").ClearContents
For i = 9 To baris
it = 0
For a = 1 To 11
If Sheet1.Cells(i, a + 3) < Sheet6.Cells(39 + a, 5 + kelase(Sheet1.Cells(i,
1))) Then
it = it + 1
Else
End If
Next a
If (it > 3 And Len(Sheet1.Cells(i, 3)) > 2) Then
itu = itu + 1
Sheets("kopi").Cells(i, 17) = z & Format(itu, "00")
Else
If (Sheet1.Cells(i, 15) < Sheet6.Cells(51, 5 + kelase(Sheet1.Cells(i, 1))) And
Len(Sheet1.Cells(i, 3)) > 2) Then
itu = itu + 1
Sheets("kopi").Cells(i, 17) = z & Format(itu, "00")
Else
End If
End If
Next i
End Sub
manakah kesalahannya?
dapat dijalankan dari sheet 1 namun tidak dapat dijalankan dari sheet6.
On Wed, Jun 15, 2016 at 8:48 AM, Nang Agus [email protected] [belajar-excel]
<[email protected]> wrote:
Asalamualaikum wrahmatullah,
Kepada Member B-Excel.
Saya membuat sebuah perintah VBA. Perintah tersebut dapat dijalankan dari
sheet1 namun tidak dapat dijalankan dari sheet6, Manakah penulisan yang salah?
Sub Etung() Dim kl As String Dim i As Integer Dim baris As Integer Dim a As
Integer Dim it As Integer Dim z As Integer Dim itu As Integer baris =
Sheet1.Range("A10000").End(xlUp).row z = 7
Sheet1.Range("Q9:Q1000").ClearContents For i = 9 To baris it = 0 For a = 1 To
11 If Sheet1.Cells(i, a + 3) < Sheet3.Cells(29 + a, 5 + kelase(Sheet1.Cells(i,
1))) Then it = it + 1 Else End If Next a If (it > 3 And
Len(Sheet1.Cells(i, 3)) > 2) Then itu = itu + 1 Sheets("kopi").Cells(i, 17)
= z & Format(itu, "00") Else If (Sheet1.Cells(i, 15) < Sheet3.Cells(41, 5 +
kelase(Sheet1.Cells(i, 1))) And Len(Sheet1.Cells(i, 3)) > 2) Then itu = itu +
1 Sheets("kopi").Cells(i, 17) = z & Format(itu, "00") Else End If End If
Next i End Sub
atas perhatiannya diucapkan terima kasih.
Wasalamualaikum warahmatullah.
NangAgus
#yiv5220571794 #yiv5220571794 -- #yiv5220571794ygrp-mkp {border:1px solid
#d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv5220571794
#yiv5220571794ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv5220571794
#yiv5220571794ygrp-mkp #yiv5220571794hd
{color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}#yiv5220571794 #yiv5220571794ygrp-mkp #yiv5220571794ads
{margin-bottom:10px;}#yiv5220571794 #yiv5220571794ygrp-mkp .yiv5220571794ad
{padding:0 0;}#yiv5220571794 #yiv5220571794ygrp-mkp .yiv5220571794ad p
{margin:0;}#yiv5220571794 #yiv5220571794ygrp-mkp .yiv5220571794ad a
{color:#0000ff;text-decoration:none;}#yiv5220571794 #yiv5220571794ygrp-sponsor
#yiv5220571794ygrp-lc {font-family:Arial;}#yiv5220571794
#yiv5220571794ygrp-sponsor #yiv5220571794ygrp-lc #yiv5220571794hd {margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}#yiv5220571794
#yiv5220571794ygrp-sponsor #yiv5220571794ygrp-lc .yiv5220571794ad
{margin-bottom:10px;padding:0 0;}#yiv5220571794 #yiv5220571794actions
{font-family:Verdana;font-size:11px;padding:10px 0;}#yiv5220571794
#yiv5220571794activity
{background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv5220571794
#yiv5220571794activity span {font-weight:700;}#yiv5220571794
#yiv5220571794activity span:first-child
{text-transform:uppercase;}#yiv5220571794 #yiv5220571794activity span a
{color:#5085b6;text-decoration:none;}#yiv5220571794 #yiv5220571794activity span
span {color:#ff7900;}#yiv5220571794 #yiv5220571794activity span
.yiv5220571794underline {text-decoration:underline;}#yiv5220571794
.yiv5220571794attach
{clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}#yiv5220571794 .yiv5220571794attach div a
{text-decoration:none;}#yiv5220571794 .yiv5220571794attach img
{border:none;padding-right:5px;}#yiv5220571794 .yiv5220571794attach label
{display:block;margin-bottom:5px;}#yiv5220571794 .yiv5220571794attach label a
{text-decoration:none;}#yiv5220571794 blockquote {margin:0 0 0
4px;}#yiv5220571794 .yiv5220571794bold
{font-family:Arial;font-size:13px;font-weight:700;}#yiv5220571794
.yiv5220571794bold a {text-decoration:none;}#yiv5220571794 dd.yiv5220571794last
p a {font-family:Verdana;font-weight:700;}#yiv5220571794 dd.yiv5220571794last p
span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv5220571794
dd.yiv5220571794last p span.yiv5220571794yshortcuts
{margin-right:0;}#yiv5220571794 div.yiv5220571794attach-table div div a
{text-decoration:none;}#yiv5220571794 div.yiv5220571794attach-table
{width:400px;}#yiv5220571794 div.yiv5220571794file-title a, #yiv5220571794
div.yiv5220571794file-title a:active, #yiv5220571794
div.yiv5220571794file-title a:hover, #yiv5220571794 div.yiv5220571794file-title
a:visited {text-decoration:none;}#yiv5220571794 div.yiv5220571794photo-title a,
#yiv5220571794 div.yiv5220571794photo-title a:active, #yiv5220571794
div.yiv5220571794photo-title a:hover, #yiv5220571794
div.yiv5220571794photo-title a:visited {text-decoration:none;}#yiv5220571794
div#yiv5220571794ygrp-mlmsg #yiv5220571794ygrp-msg p a
span.yiv5220571794yshortcuts
{font-family:Verdana;font-size:10px;font-weight:normal;}#yiv5220571794
.yiv5220571794green {color:#628c2a;}#yiv5220571794 .yiv5220571794MsoNormal
{margin:0 0 0 0;}#yiv5220571794 o {font-size:0;}#yiv5220571794
#yiv5220571794photos div {float:left;width:72px;}#yiv5220571794
#yiv5220571794photos div div {border:1px solid
#666666;height:62px;overflow:hidden;width:62px;}#yiv5220571794
#yiv5220571794photos div label
{color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv5220571794
#yiv5220571794reco-category {font-size:77%;}#yiv5220571794
#yiv5220571794reco-desc {font-size:77%;}#yiv5220571794 .yiv5220571794replbq
{margin:4px;}#yiv5220571794 #yiv5220571794ygrp-actbar div a:first-child
{margin-right:2px;padding-right:5px;}#yiv5220571794 #yiv5220571794ygrp-mlmsg
{font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv5220571794
#yiv5220571794ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv5220571794
#yiv5220571794ygrp-mlmsg select, #yiv5220571794 input, #yiv5220571794 textarea
{font:99% Arial, Helvetica, clean, sans-serif;}#yiv5220571794
#yiv5220571794ygrp-mlmsg pre, #yiv5220571794 code {font:115%
monospace;}#yiv5220571794 #yiv5220571794ygrp-mlmsg *
{line-height:1.22em;}#yiv5220571794 #yiv5220571794ygrp-mlmsg #yiv5220571794logo
{padding-bottom:10px;}#yiv5220571794 #yiv5220571794ygrp-msg p a
{font-family:Verdana;}#yiv5220571794 #yiv5220571794ygrp-msg
p#yiv5220571794attach-count span {color:#1E66AE;font-weight:700;}#yiv5220571794
#yiv5220571794ygrp-reco #yiv5220571794reco-head
{color:#ff7900;font-weight:700;}#yiv5220571794 #yiv5220571794ygrp-reco
{margin-bottom:20px;padding:0px;}#yiv5220571794 #yiv5220571794ygrp-sponsor
#yiv5220571794ov li a {font-size:130%;text-decoration:none;}#yiv5220571794
#yiv5220571794ygrp-sponsor #yiv5220571794ov li
{font-size:77%;list-style-type:square;padding:6px 0;}#yiv5220571794
#yiv5220571794ygrp-sponsor #yiv5220571794ov ul {margin:0;padding:0 0 0
8px;}#yiv5220571794 #yiv5220571794ygrp-text
{font-family:Georgia;}#yiv5220571794 #yiv5220571794ygrp-text p {margin:0 0 1em
0;}#yiv5220571794 #yiv5220571794ygrp-text tt {font-size:120%;}#yiv5220571794
#yiv5220571794ygrp-vital ul li:last-child {border-right:none
!important;}#yiv5220571794