SHARE
TWEET

Untitled

a guest Dec 11th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Sub CommandButton1_Click()
  2.  
  3. Dim *Data* As FileDialog
  4. Set *Data* = Application.FileDialog(msoFileDialogOpen)
  5. Dim *FileName* As String[***]
  6. If *Data*.Show = -1 Then[***]
  7. *FileName* = Data.SelectedItems(1)[***]
  8. End If
  9.  
  10. Dim *KlientList* As Workbook[***]
  11. Dim *KlientInfo* As Workbook[***]
  12. Dim *DataX* As Worksheet[***]
  13. Dim *MyData* As Worksheet[***]
  14. Set *KlientList* = Workbooks.Open(*FileName*)[***]
  15. Set *KlientInfo* = ThisWorkbook
  16. Set *DataX* = *KlientList*.Sheets("Sheet1")[***]
  17. Set *MyData* = *KlientInfo*.Sheets("Sheet1")[***]
  18.  
  19. *LastRow* = Range("A1").End(xlDown).Row[***]
  20. *LastCol* = Range("A1").End(xlToRight).Column[***]
  21. *DataX*.Range(*DataX*.Cells(1, 1), *DataX*.Cells(*LastRow*, *LastCol*)).Copy Destination:=*MyData*.Range(*MyData*.Cells(1, 1), *MyData*.Cells(*LastRow*, *LastCol*))[***]
  22.  
  23. ActiveWorkbook.Close
  24.  
  25. Dim cell As Range
  26. For Each cell In Worksheets("Sheet1").Range(*MyData*.Cells(2, 1), *MyData*.Cells(*LastRow*, 1)) [***]
  27.     ListBox1.AddItem cell.Value
  28. Next cell
  29.  
  30. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top