Tecnologia, programação e muito Visual FoxPro.

terça-feira, 26 de janeiro de 2010

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

 

Sub NamaBulan()
bln = "12122010"
bln = Mid(bln, 3, 2)
bln = CInt(bln) & "/1/" & Year(Date)
With Application.WorksheetFunction
tgl = CDate(bln)
Bulan = UCase(.Text(tgl, "[$-421]mmmm yyyy"))
[A1] = "RESUME REALISASI PEMANFAATAN DANA BULAN " + Bulan
End With
End Sub

________________________________________
From: XL-mania@yahoogroups.com [mailto:XL-mania@yahoogroups.com] On Behalf
Of Herry Sutjipto
Sent: Wednesday, January 27, 2010 7:43 AM
To: XL-mania@yahoogroups.com
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



__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4808 (20100126) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

__._,_.___
+-:: 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