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

[µo°Ý] .RefersTo ¥i§_¦³¿z¿ï¯à¤O

[µo°Ý] .RefersTo ¥i§_¦³¿z¿ï¯à¤O

½Ð±Ð¤j¤j:
µ{¦¡»yªk¦p¤U,¦pªGListBox2·Q­n¦³¿z¿ï¤§«á§e²{
¨Ò¦p²Ä¥|Äæ¦ì¬°©m¦W(TextBox4) ,like TextBox4 §¡list ©ó ListBox2
À³¦p¦ó¼g?
Sub showlastdatas()
    Dim str1 As String
    wb3.Activate
    str1 = Left(TextBox31, 5) & CommandButton4.Caption
    With Sheets(str1)
        row1 = .Cells(65536, 4).End(xlUp).Row
        If row1 < 2 Then Exit Sub
        Dim mystr As String
        With Application.Names.Add("Tmp2", .Range(.Cells(2, 1), .Cells(row1, 24)))
            mystr = .RefersTo
            .Delete
        End With
        ListBox2.RowSource = ""
        With ListBox2
            .ColumnCount = 24
            .ColumnWidths = "78pt;60pt;80pt;70pt;40pt;105pt;90pt;115pt;90pt;90pt;90pt;70pt;70pt;80pt;90pt;90pt;90pt;120pt;120pt;120pt;80pt;120pt;80pt;60pt"
            .RowSource = mystr
            .ColumnHeads = True
            .ListIndex = ListBox2.ListCount - 1
        End With
    End With
End Sub
·PÁ«ü¾É

¥»©«³Ì«á¥Ñ yangjie ©ó 2021-1-14 22:46 ½s¿è

§Ú·Q¥i¯à½Ñ¦ì¤j¤j¤£À´§Úªº§xÂZ©Ò¦b
Dim mystr As String
        With Application.Names.Add("Tmp2", .Range(.Cells(2, 1), .Cells(row1, 24)))
              'Tmp2¬O¥þ³¡¸ê®Æ,¦Ó§Ú­nªº¬O§t³¡¤À±ø¥ó¤§¸ê®Æ
            'Tmp2¦bRange(.Cells(2, 1), .Cells(row1, 24))¤§¤¤¿z¿ï¥X.cell(ii,4)=Textbox4ªº¨C¤@¦C
            '¬O§_À³¥ý¿z¿ï¨ì¥t¤@­ÓsheetsµM«á¦Amystr = .RefersTo
            mystr = .RefersTo
            .Delete
        End With
        ListBox2.RowSource = ""
        With ListBox2
            .ColumnCount = 24
            .ColumnWidths = "78pt;60pt;80pt;70pt;..........."
            .RowSource = mystr
            .ColumnHeads = True
            .ListIndex = ListBox2.ListCount - 1
        End With
    End With
·q½Ð«ü¾É ¤£³Ó·P¿E

TOP

¦^´_ 2# yangjie


±N²Å¦Xtextbox4ªº¸ê®Æ±½¶i·sªº°}¦C©Î¦r¨å¤¤,
¦A±N°}¦C²M³æ¶ë¶ilist¤¤~~

TOP

¦^´_ 3# ­ã´£³¡ªL
ÁÂÁª©¥D¤j¤j
   ¦C°} §Ú©|¥¼ºë¼ôºN¯Á¤¤ ¦Ó¦r¨å¤£¬O§ä¯Á¤Þ¬Û²§¶Ü
   ¥i§_°µ­Ó½d¨Ò Åý§Ú¾Ç¤@¾Ç
¾Ç¸¹¦b²Ä¥|Äæ Data¦@24Äæ   ¦Ó²Ä25Ä欰¸Ó¦C¤§rows   ¨Ì¾Ç¸¹ §ä¬Û¦ü©ó
À³¦p¦ó¶ë¤JDictionary
¦A D= .refersTo


¯uªºÀµ½Ð«ü¾É«á¾Ç

TOP

¦^´_ 4# yangjie


Ãö¤_¥ô¦ó°ÝÃD, ±o¤W¶ÇÀÉ®×, ¤~¯à°µ°ÝÃD¬ã§P¤Î´ú¸Õ.

TOP

        ÀR«ä¦Û¦b : Ä@­n¤j¡B§Ó­n°í¡B®ð­n¬X¡B¤ß­n²Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD