Tecnologia, programação e muito Visual FoxPro.

terça-feira, 26 de janeiro de 2010

Re: ]] XL-mania [[ Penyederhanaan If Else End If

 

Coba pake Select Case
 
Bln=Mid(Bln,3,2)
Select Case Bln
Case "01"
Bulan="JANUARI"
Case "02"
Bulan="FEBRUARI"
Case "03"
Bulan="MARET"
Case "04"
Bulan="APRIL"
Case "05"
Bulan="MEI"
Case "06"
Bulan="JUNI"
Case "07"
Bulan="JULI"
Case "08"
Bulan="AGUSTUS"
Case "09"
Bulan="SEPTEMBER"
Case "10"
Bulan="OKTOBER"
Case "11"
Bulan="NOPEMBER"
Case "12"
Bulan="DESEMBER"
End Select
 
RAnge("A1") = "RESUME REALISASI PEMANFAATAN DANA BULAN " + Bulan + " 2010"
 
 
Regards
Dadan
 
 
 
----- Original Message -----
Sent: Wednesday, January 27, 2010 7:42 AM
Subject: ]] XL-mania [[ Penyederhanaan If Else End If

 

 Dear para XL-Mania –er,

Ada ide untuk menyederhanakan VBA berikut ini?

    Bln = Sheets(2).Name

    Bln = Mid(Bln, 3, 2)

    If Bln = "01" Then

       Bulan = "JANUARI"

    Else

       If Bln = "02" Then

          Bulan = "FEBRUARI"

       Else

          If Bln = "03" Then

             Bulan = "MARET"

          Else

             If Bln = "04" Then

                Bulan = "APRIL"

             Else

                If Bln = "05" Then

                   Bulan = "MEI"

                Else

                   If Bln = "06" Then

                      Bulan = "JUNI"

                   Else

                      If Bln = "07" Then

                         Bulan = "JULI"

                      Else

                         If Bln = "08" Then

                            Bulan = "AGUSTUS"

                         Else

                            If Bln = "09" Then

                               Bulan = "SEPTEMBER"

                            Else

                               If Bln = "10" Then

                                  Bulan = "OKTOBER"

                               Else

                                  If Bln = "11" Then

                                     Bulan = "NOPEMBER"

                                  Else

                                     If Bln = "12" Then

                                        Bulan = "DESEMBER"

                                     Else

                                        Bulan = "Salah Format!"

                                     End If

                                  End If

                               End If

                            End If

                         End If

                      End If

                   End If

                End If

             End If

          End If

       End If

    End If

    Range("A1") = "RESUME REALISASI PEMANFAATAN DANA BULAN " + Bulan + " 2010"

Terima kasih.

Best regards

Herry Sutjipto

__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| Member ke 13,013 siapa ya? Sini mau dikirimin coklat :D           |
| Member ke 31,031 dapet iPod dehh.... :D :D :D                     |  
| http://www.facebook.com/group.php?gid=37671048001&ref=mf          |
+-------------------------------------------------------------------+
| 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.friendster.com/xlmania atau...  |
| 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