Hello everyone,
I have attached my file.
After importing a CSV File into excel, I have this data (file). Until now, I have created a data table that saves the information that I have in this file, and I want to create a new Sheet with the information but more organized.
New sheet that presents the data in column A (product) Column B (price)... does any one can help me to instriduce the code that arrays the information.
The real file has until 10000 products!!!
Thank you
I paste my code to create the "Table Array".
HTML
Sub FindTBL()
Dim MyRange As Range
Dim MiTBL() As String
Dim Abuscar As String
Dim k, i As Integer
Dim NewCSV As Worksheet
Dim Variables As Range
Abuscar = "c_abc_ini_typ"
'Set MyRange = ActiveSheet.Range("C1:C2000")
Set MyRange = Range("C:C")
'With Worksheets("CSV").Range("C1:C200")
With Worksheets("CSV").Range("C:C")
Set MiBusqueda = .Find(What:=Abuscar, MatchCase:=False)
If Not MiBusqueda Is Nothing Then
FirstAddress = MiBusqueda.Address
Do
k = k + 1
ReDim Preserve MiTBL(2, 1 To k)
MiTBL(1, k) = MiBusqueda
MiTBL(2, k) = Range(MiBusqueda.Address).Offset(-1, 0).Value
Set MiBusqueda = .FindNext(MiBusqueda)
Loop While Not MiBusqueda Is Nothing And MiBusqueda.Address <> FirstAddress
End If
End With
For i = 1 To k
MsgBox MiTBL(1, i) & " = " & MiTBL(2, i)
Next i
Set NewCSV = Sheets.Add
'For i = 1 To UBound(MiTBL)
'Cells(i, 1) = MiTBL(i, 1)
'Cells(i, 2) = MiTBL(i, 2)
'Next i
'Set Variables = Range("A:A")
'Variables.Value = MiTBL(1, k)
End Sub
Display More