Tecnologia, programação e muito Visual FoxPro.

segunda-feira, 19 de agosto de 2013

]] XL-mania [[ Mencari baris kosong

 

Selamat siang Para Masters, Mohon Pencerahan mengenai mencari baris kosong untuk penginputan.
Berikut ini coding yang sudah saya buat
Private Sub cmdsubmit_Click()

Dim ws As Worksheet
Set ws = Worksheets("DONE")

'Menyimpan data
If Me.cboCopet.Value = "GUDANG GARAM" Then
ws.Cells(4, 2).Value = Me.tnama.Value
ws.Cells(4, 3).Value = Me.tkec.Value
ws.Cells(4, 4).Value = Me.tkab.Value
ws.Cells(4, 5).Value = Me.talm.Value
ws.Cells(4, 6).Value = Me.timo.Value
ws.Cells(4, 7).Value = Me.tare.Value
ws.Cells(4, 8).Value = Me.tq1.Value
ws.Cells(4, 9).Value = Me.tq2.Value
ws.Cells(4, 10).Value = Me.tq3.Value
ws.Cells(4, 11).Value = Me.tq4.Value
ws.Cells(4, 12).Value = Me.tq5.Value
ws.Cells(4, 13).Value = Me.tq6a.Value
ws.Cells(4, 14).Value = Me.tq6b.Value
ws.Cells(4, 15).Value = Me.tq6c.Value
ws.Cells(4, 16).Value = Me.tq6d.Value
ws.Cells(4, 17).Value = Me.tq6e.Value
ws.Cells(4, 18).Value = Me.tq7.Value
ws.Cells(4, 19).Value = Me.tq8.Value
ws.Cells(4, 20).Value = Me.tq9a.Value
ws.Cells(4, 21).Value = Me.tq9b.Value
ws.Cells(4, 22).Value = Me.tq9c.Value
ws.Cells(4, 23).Value = Me.tq9d.Value
ws.Cells(4, 24).Value = Me.tq9e.Value
ws.Cells(4, 25).Value = Me.tq10.Value
ws.Cells(4, 26).Value = Me.tq11.Value
ws.Cells(4, 27).Value = Me.tq12a.Value
ws.Cells(4, 28).Value = Me.tq12b.Value
ws.Cells(4, 29).Value = Me.tq12c.Value
ws.Cells(4, 30).Value = Me.tq12d.Value
ws.Cells(4, 31).Value = Me.tq12e.Value
ws.Cells(4, 32).Value = Me.tq13.Value
ws.Cells(4, 33).Value = Me.tq14.Value
ws.Cells(4, 34).Value = Me.tq15a.Value
ws.Cells(4, 35).Value = Me.tq15b.Value
ws.Cells(4, 36).Value = Me.tq15c.Value
ws.Cells(4, 37).Value = Me.tq15d.Value
ws.Cells(4, 38).Value = Me.tq15e.Value
ws.Cells(4, 39).Value = Me.tq16.Value
ws.Cells(4, 40).Value = Me.tq17.Value
ws.Cells(4, 41).Value = Me.tq18a.Value
ws.Cells(4, 42).Value = Me.tq18b.Value
ws.Cells(4, 43).Value = Me.tq18c.Value
ws.Cells(4, 44).Value = Me.tq18d.Value
ws.Cells(4, 45).Value = Me.tq18e.Value
ws.Cells(4, 46).Value = Me.tq19.Value
ws.Cells(4, 47).Value = Me.tq20.Value
ws.Cells(4, 48).Value = Me.tq21a.Value
ws.Cells(4, 49).Value = Me.tq21b.Value
ws.Cells(4, 50).Value = Me.tq21c.Value
ws.Cells(4, 51).Value = Me.tq21d.Value
ws.Cells(4, 52).Value = Me.tq21e.Value
End If
If Me.cboCopet.Value = "DJARUM" Then
ws.Cells(4, 53).Value = Me.tq1.Value
ws.Cells(4, 54).Value = Me.tq2.Value
ws.Cells(4, 55).Value = Me.tq3.Value
ws.Cells(4, 56).Value = Me.tq4.Value
ws.Cells(4, 57).Value = Me.tq5.Value
ws.Cells(4, 58).Value = Me.tq6a.Value
ws.Cells(4, 59).Value = Me.tq6b.Value
ws.Cells(4, 60).Value = Me.tq6c.Value
ws.Cells(4, 61).Value = Me.tq6d.Value
ws.Cells(4, 62).Value = Me.tq6e.Value
ws.Cells(4, 63).Value = Me.tq7.Value
ws.Cells(4, 64).Value = Me.tq8.Value
ws.Cells(4, 65).Value = Me.tq9a.Value
ws.Cells(4, 66).Value = Me.tq9b.Value
ws.Cells(4, 67).Value = Me.tq9c.Value
ws.Cells(4, 68).Value = Me.tq9d.Value
ws.Cells(4, 69).Value = Me.tq9e.Value
ws.Cells(4, 70).Value = Me.tq10.Value
ws.Cells(4, 71).Value = Me.tq11.Value
ws.Cells(4, 72).Value = Me.tq12a.Value
ws.Cells(4, 73).Value = Me.tq12b.Value
ws.Cells(4, 74).Value = Me.tq12c.Value
ws.Cells(4, 75).Value = Me.tq12d.Value
ws.Cells(4, 76).Value = Me.tq12e.Value
ws.Cells(4, 77).Value = Me.tq13.Value
ws.Cells(4, 78).Value = Me.tq14.Value
ws.Cells(4, 79).Value = Me.tq15a.Value
ws.Cells(4, 80).Value = Me.tq15b.Value
ws.Cells(4, 81).Value = Me.tq15c.Value
ws.Cells(4, 82).Value = Me.tq15d.Value
ws.Cells(4, 83).Value = Me.tq15e.Value
ws.Cells(4, 84).Value = Me.tq16.Value
ws.Cells(4, 85).Value = Me.tq17.Value
ws.Cells(4, 86).Value = Me.tq18a.Value
ws.Cells(4, 87).Value = Me.tq18b.Value
ws.Cells(4, 88).Value = Me.tq18c.Value
ws.Cells(4, 89).Value = Me.tq18d.Value
ws.Cells(4, 90).Value = Me.tq18e.Value
ws.Cells(4, 91).Value = Me.tq19.Value
ws.Cells(4, 92).Value = Me.tq20.Value
ws.Cells(4, 93).Value = Me.tq21a.Value
ws.Cells(4, 94).Value = Me.tq21b.Value
ws.Cells(4, 95).Value = Me.tq21c.Value
ws.Cells(4, 96).Value = Me.tq21d.Value
ws.Cells(4, 97).Value = Me.tq21e.Value
End If
If Me.cboCopet.Value = "BENTOEL+BAT" Then
ws.Cells(4, 98).Value = Me.tq1.Value
ws.Cells(4, 99).Value = Me.tq2.Value
ws.Cells(4, 100).Value = Me.tq3.Value
ws.Cells(4, 101).Value = Me.tq4.Value
ws.Cells(4, 102).Value = Me.tq5.Value
ws.Cells(4, 103).Value = Me.tq6a.Value
ws.Cells(4, 104).Value = Me.tq6b.Value
ws.Cells(4, 105).Value = Me.tq6c.Value
ws.Cells(4, 106).Value = Me.tq6d.Value
ws.Cells(4, 107).Value = Me.tq6e.Value
ws.Cells(4, 108).Value = Me.tq7.Value
ws.Cells(4, 109).Value = Me.tq8.Value
ws.Cells(4, 110).Value = Me.tq9a.Value
ws.Cells(4, 111).Value = Me.tq9b.Value
ws.Cells(4, 112).Value = Me.tq9c.Value
ws.Cells(4, 113).Value = Me.tq9d.Value
ws.Cells(4, 114).Value = Me.tq9e.Value
ws.Cells(4, 115).Value = Me.tq10.Value
ws.Cells(4, 116).Value = Me.tq11.Value
ws.Cells(4, 117).Value = Me.tq12a.Value
ws.Cells(4, 118).Value = Me.tq12b.Value
ws.Cells(4, 119).Value = Me.tq12c.Value
ws.Cells(4, 120).Value = Me.tq12d.Value
ws.Cells(4, 121).Value = Me.tq12e.Value
ws.Cells(4, 122).Value = Me.tq13.Value
ws.Cells(4, 123).Value = Me.tq14.Value
ws.Cells(4, 124).Value = Me.tq15a.Value
ws.Cells(4, 125).Value = Me.tq15b.Value
ws.Cells(4, 126).Value = Me.tq15c.Value
ws.Cells(4, 127).Value = Me.tq15d.Value
ws.Cells(4, 128).Value = Me.tq15e.Value
ws.Cells(4, 129).Value = Me.tq16.Value
ws.Cells(4, 130).Value = Me.tq17.Value
ws.Cells(4, 131).Value = Me.tq18a.Value
ws.Cells(4, 132).Value = Me.tq18b.Value
ws.Cells(4, 133).Value = Me.tq18c.Value
ws.Cells(4, 134).Value = Me.tq18d.Value
ws.Cells(4, 135).Value = Me.tq18e.Value
ws.Cells(4, 136).Value = Me.tq19.Value
ws.Cells(4, 137).Value = Me.tq20.Value
ws.Cells(4, 138).Value = Me.tq21a.Value
ws.Cells(4, 139).Value = Me.tq21b.Value
ws.Cells(4, 140).Value = Me.tq21c.Value
ws.Cells(4, 141).Value = Me.tq21d.Value
ws.Cells(4, 142).Value = Me.tq21e.Value
End If
If Me.cboCopet.Value = "NOJORONO" Then
ws.Cells(4, 143).Value = Me.tq1.Value
ws.Cells(4, 144).Value = Me.tq2.Value
ws.Cells(4, 145).Value = Me.tq3.Value
ws.Cells(4, 146).Value = Me.tq4.Value
ws.Cells(4, 147).Value = Me.tq5.Value
ws.Cells(4, 148).Value = Me.tq6a.Value
ws.Cells(4, 149).Value = Me.tq6b.Value
ws.Cells(4, 150).Value = Me.tq6c.Value
ws.Cells(4, 151).Value = Me.tq6d.Value
ws.Cells(4, 152).Value = Me.tq6e.Value
ws.Cells(4, 153).Value = Me.tq7.Value
ws.Cells(4, 154).Value = Me.tq8.Value
ws.Cells(4, 155).Value = Me.tq9a.Value
ws.Cells(4, 156).Value = Me.tq9b.Value
ws.Cells(4, 157).Value = Me.tq9c.Value
ws.Cells(4, 158).Value = Me.tq9d.Value
ws.Cells(4, 159).Value = Me.tq9e.Value
ws.Cells(4, 160).Value = Me.tq10.Value
ws.Cells(4, 161).Value = Me.tq11.Value
ws.Cells(4, 162).Value = Me.tq12a.Value
ws.Cells(4, 163).Value = Me.tq12b.Value
ws.Cells(4, 164).Value = Me.tq12c.Value
ws.Cells(4, 165).Value = Me.tq12d.Value
ws.Cells(4, 166).Value = Me.tq12e.Value
ws.Cells(4, 167).Value = Me.tq13.Value
ws.Cells(4, 168).Value = Me.tq14.Value
ws.Cells(4, 169).Value = Me.tq15a.Value
ws.Cells(4, 170).Value = Me.tq15b.Value
ws.Cells(4, 171).Value = Me.tq15c.Value
ws.Cells(4, 172).Value = Me.tq15d.Value
ws.Cells(4, 173).Value = Me.tq15e.Value
ws.Cells(4, 174).Value = Me.tq16.Value
ws.Cells(4, 175).Value = Me.tq17.Value
ws.Cells(4, 176).Value = Me.tq18a.Value
ws.Cells(4, 177).Value = Me.tq18b.Value
ws.Cells(4, 178).Value = Me.tq18c.Value
ws.Cells(4, 179).Value = Me.tq18d.Value
ws.Cells(4, 180).Value = Me.tq18e.Value
ws.Cells(4, 181).Value = Me.tq19.Value
ws.Cells(4, 182).Value = Me.tq20.Value
ws.Cells(4, 183).Value = Me.tq21a.Value
ws.Cells(4, 184).Value = Me.tq21b.Value
ws.Cells(4, 185).Value = Me.tq21c.Value
ws.Cells(4, 186).Value = Me.tq21d.Value
ws.Cells(4, 187).Value = Me.tq21e.Value
End If
If Me.cboCopet.Value = "OTHERS" Then
ws.Cells(4, 188).Value = Me.tq1.Value
ws.Cells(4, 189).Value = Me.tq2.Value
ws.Cells(4, 190).Value = Me.tq3.Value
ws.Cells(4, 191).Value = Me.tq4.Value
ws.Cells(4, 192).Value = Me.tq5.Value
ws.Cells(4, 193).Value = Me.tq6a.Value
ws.Cells(4, 194).Value = Me.tq6b.Value
ws.Cells(4, 195).Value = Me.tq6c.Value
ws.Cells(4, 196).Value = Me.tq6d.Value
ws.Cells(4, 197).Value = Me.tq6e.Value
ws.Cells(4, 198).Value = Me.tq7.Value
ws.Cells(4, 199).Value = Me.tq8.Value
ws.Cells(4, 200).Value = Me.tq9a.Value
ws.Cells(4, 201).Value = Me.tq9b.Value
ws.Cells(4, 202).Value = Me.tq9c.Value
ws.Cells(4, 203).Value = Me.tq9d.Value
ws.Cells(4, 204).Value = Me.tq9e.Value
ws.Cells(4, 205).Value = Me.tq10.Value
ws.Cells(4, 206).Value = Me.tq11.Value
ws.Cells(4, 207).Value = Me.tq12a.Value
ws.Cells(4, 208).Value = Me.tq12b.Value
ws.Cells(4, 209).Value = Me.tq12c.Value
ws.Cells(4, 210).Value = Me.tq12d.Value
ws.Cells(4, 211).Value = Me.tq12e.Value
ws.Cells(4, 212).Value = Me.tq13.Value
ws.Cells(4, 213).Value = Me.tq14.Value
ws.Cells(4, 214).Value = Me.tq15a.Value
ws.Cells(4, 215).Value = Me.tq15b.Value
ws.Cells(4, 216).Value = Me.tq15c.Value
ws.Cells(4, 217).Value = Me.tq15d.Value
ws.Cells(4, 218).Value = Me.tq15e.Value
ws.Cells(4, 219).Value = Me.tq16.Value
ws.Cells(4, 220).Value = Me.tq17.Value
ws.Cells(4, 221).Value = Me.tq18a.Value
ws.Cells(4, 222).Value = Me.tq18b.Value
ws.Cells(4, 223).Value = Me.tq18c.Value
ws.Cells(4, 224).Value = Me.tq18d.Value
ws.Cells(4, 225).Value = Me.tq18e.Value
ws.Cells(4, 226).Value = Me.tq19.Value
ws.Cells(4, 227).Value = Me.tq20.Value
ws.Cells(4, 228).Value = Me.tq21a.Value
ws.Cells(4, 229).Value = Me.tq21b.Value
ws.Cells(4, 230).Value = Me.tq21c.Value
ws.Cells(4, 231).Value = Me.tq21d.Value
ws.Cells(4, 232).Value = Me.tq21e.Value
End If

'membuat kunci textbox
If Range("A1").Value = "OTHERS" Then
'clear data Textbox
Me.tnama.Value = ""
Me.tkec.Value = ""
Me.tkab.Value = ""
Me.talm.Value = ""
Me.timo.Value = ""
Me.tare.Value = ""
End If
UserForm1.tnama.Enabled = False
UserForm1.tkec.Enabled = False
UserForm1.talm.Enabled = False
UserForm1.tkab.Enabled = False
UserForm1.timo.Enabled = False
UserForm1.tare.Enabled = False
If Range("A1").Value = "OTHERS" Then
UserForm1.tnama.Enabled = True
UserForm1.tkec.Enabled = True
UserForm1.talm.Enabled = True
UserForm1.tkab.Enabled = True
UserForm1.timo.Enabled = True
UserForm1.tare.Enabled = True
End If

'clear data Textbox
Me.tq1.Value = ""
Me.tq2.Value = ""
Me.tq3.Value = ""
Me.tq4.Value = ""
Me.tq5.Value = ""
Me.tq6a.Value = ""
Me.tq6b.Value = ""
Me.tq6c.Value = ""
Me.tq6d.Value = ""
Me.tq6e.Value = ""
Me.tq7.Value = ""
Me.tq8.Value = ""
Me.tq9a.Value = ""
Me.tq9b.Value = ""
Me.tq9c.Value = ""
Me.tq9d.Value = ""
Me.tq9e.Value = ""
Me.tq10.Value = ""
Me.tq11.Value = ""
Me.tq12a.Value = ""
Me.tq12b.Value = ""
Me.tq12c.Value = ""
Me.tq12d.Value = ""
Me.tq12e.Value = ""
Me.tq13.Value = ""
Me.tq14.Value = ""
Me.tq15a.Value = ""
Me.tq15b.Value = ""
Me.tq15c.Value = ""
Me.tq15d.Value = ""
Me.tq15e.Value = ""
Me.tq16.Value = ""
Me.tq17.Value = ""
Me.tq18a.Value = ""
Me.tq18b.Value = ""
Me.tq18c.Value = ""
Me.tq18d.Value = ""
Me.tq18e.Value = ""
Me.tq19.Value = ""
Me.tq20.Value = ""
Me.tq21a.Value = ""
Me.tq21b.Value = ""
Me.tq21c.Value = ""
Me.tq21d.Value = ""
Me.tq21e.Value = ""

Selection.Offset(1, 0).Select

cboCopet.RemoveItem cboCopet.ListIndex
cboCopet.ListIndex = -1
If Range("A1").Value = "OTHERS" Then
Call UserForm_Initialize
End If

End sub
Dari coding di atas bagaimana bila saya ingin menginput lagi dan hasil nya di simpan di baris kosong, tidak menimpa hasil yang sudah saya buat.
Terima kasih

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| Maaf moderasi terlambat karena yahoogroups sering error           |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message,  melecehkan,  tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan  winzip  jika  perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke  |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/           |
+-------------------------------------------------------------------+
| Berikan testimoni di :                                            |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html           |
+-------------------------------------------------------------------+
| Message lama ada di :                                             |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id]  |
| http://www.mail-archive.com/xl-mania@yahoogroups.com              |
+-------------------------------------------------------------------+
.

__,_._,___

Nenhum comentário:

Arquivo do blog