ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó§â¦h个MsgBoxªº讯®§©ñ¦b¤@个对话®Ø¡H

[µo°Ý] ¦p¦ó§â¦h个MsgBoxªº讯®§©ñ¦b¤@个对话®Ø¡H

  1. Private Sub Workbook_Open()

  2. For i = 2 To Sheet1.UsedRange.Rows.Count

  3.    If ("0" < Sheet1.Cells(i, 7).Value) And (Sheet1.Cells(i, 7).Value < "4") And Cells(i, 8).Value = "PENDING" Then
  4.         MsgBox (Sheet1.Cells(i, 3).Value & "Still have" & Sheet1.Cells(i, 7).Value & "days!!! PLEASE UPDATE. ")
  5.     ElseIf ((Sheet1.Cells(i, 7).Value) < "1") And Cells(i, 8).Value = "PENDING" Then
  6.         MsgBox (Sheet1.Cells(i, 3).Value & "Still not arrive!!!!! PLEASE FOLLOW UP. ")
  7.    
  8.    End If
  9.   

  10. Next i

  11. End Sub
½Æ»s¥N½X
这个vba¥i¥H¦b¥´开excel时³qª¾§Ú¦¬单¤é´Á¨ì´Á¡A¥i¬O¨C¦¸¤@¥´开excel´N¦³«Ü¦h对话®Ø¡A请问¦³¤°¤\¤èªk¯à让©Ò¦³对话®Øªº«H®§³£©ñ¦b¤@个对话®Ø吗¡H

Untitled.png (18.23 KB)

Untitled.png

'¸Õ¸Õ¬Ý:
'¦ý MsgBox ¦r¼Æ¦³­­¨î, ¤@¦¸¤£¯à¸Ë¤Ó¦h!!
'¯à¸Ë¦h¤Ö§Ú¤£²M·¡!!
'¦pªG¸Ë¤£¤U, ´N­n¤À¬qÅã¥Ü.
Private Sub Workbook_Open()
Dim xT As String
With Sheet1
    For i = 2 To .UsedRange.Rows.Count + 1
        If .Cells(i, 8) = "PENDING" Then
            If ("0" < .Cells(i, 7)) And (.Cells(i, 7) < "4") Then
                xT = xT & (.Cells(i, 3) & " Still have" & .Cells(i, 7) & "days!!! PLEASE UPDATE. ") & Chr(10)
            ElseIf ((.Cells(i, 7)) < "1") Then
                xT = xT & (.Cells(i, 3) & " Still not arrive!!!!! PLEASE FOLLOW UP. ") & Chr(10)
            End If
        End If
    Next i
    MsgBox xT
End With
End Sub

TOP

¦pªG´£¥Ü¶µ¥Ø¤Ó¦h, ®Ú¥»°O¤£¦í, ¥ÎMSGBOXÅã¥Üªº¤º®e¤£¨ã¹ê¥Î,
¤£¦pÀˬd¥X¦³¶·´£¥Ü«á§YÅã¥Ü°T®§(¤£¶·¥þ³¡Àˬd§¹¦¨¤~´£¥Ü),
¥u­nª¾¹D¥²¶·¤H¤uÀˬd¦³¸ê®Æ¶·³B²z§Y¥i,
·f°t±ø¥ó®æ¦¡«G¥X²Å¦X±ø¥óªÌ, ´N¤@¥ØÁAµM!!!

TOP

¦^´_ 2# yen956


    ¦¨¥\¤F¡I«D±`·P谢~虽µM讯®§¤Ó¦h显¥Ü¤£§¹~ :)

TOP

¦^´_ 3# ­ã´£³¡ªL


    ªºÚÌ装¤£§¹~
谢谢§Aªº´£议~

TOP

¤j¤j¥i¥H¥Î UserForm  ¤W­±¬Ý­n¥Î ListBox ÁÙ¬O TextBox
³o¼Ë´N¸Ëªº¤U¤F

TOP

³o¬O®Ú¾Ú­ã¤jªº«Øij©Ò°µªº­×¥¿:
¸Õ¸Õ¬Ý:
Private Sub Workbook_Open()
Dim I As Integer
With Sheet1
    For I = 2 To .UsedRange.Rows.Count + 1
        If .Cells(I, 8) = "PENDING" Then
            If ("0" < .Cells(I, 7)) And (.Cells(I, 7) < "4") Then
                 .Cells(I, 3).Interior.ColorIndex = 36
            ElseIf ((.Cells(I, 7)) < "1") Then
                 .Cells(I, 3).Interior.ColorIndex = 38
            End If
        End If
    Next I
End With
End Sub

TOP

¦^´_ 6# jackyq


    谢谢这¦ì¤j¤jªº´£议~¦b¤Uµæ鸟¤@¥u~¥Ø«e还¤£会Userform~¤£过¦b¤U会尝试ªº~·P谢~XD

TOP

¥»©«³Ì«á¥Ñ jeffrylky ©ó 2016-3-17 15:43 ½s¿è

¦^´_ 7# yen956


    «D±`·P谢这¦ì¤j¤j

TOP

¦^´_ 7# yen956


    «D±`·P谢这¦ì¤j¤j´£¨Ñªºvba~¤£µM¦b¤U¤£ª¾¹D»Ý­n¬ã¨s¦h¤[¤F~¦³¤F¤j¤jªºvba­Ë¬O¤£¥Î¨ì处§ä¤F~ª½±µ从¤j¤jªºvba¤¤学习~

TOP

        ÀR«ä¦Û¦b : ¤£©È¨Æ¦h¡A¥u©È¦h¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD