I am new to Visual Basic 6 and I have a problem.
I need to create folders using two columns, that is, in each folder I have to appear the contents of A1 and F1 separated by a low script, for example, and so on.
Searching forums and YouTube I found:
Sub CrearCarpetas()
ruta = InputBox("INGRESAR LA RUTA")
Range("A2").Select
Do While ActiveCell.Value <> ""
MkDir (ruta & "/" & ActiveCell.Value)
ActiveCell.Offset(1, 0).Select
Loop
End Sub
And similar, which are fine but only serve for one column. What I need is, based on a basic example of an excel sheet:
Nombre Apellido Otros
1 a mm
2 s nn
3 d pp
4 f kk
I want to create folders with the contents of A2_C2, A3_C3, etc ... I have tried with random things of the style:
Sub CrearCarpetas2()
ruta = InputBox("INGRESAR RUTA")
Dim fila1 As String, fila2 As String
fila1 = Range("A2").Select
fila2 = Range("C2").Select
If Dir(fila1 & fila2) = Empty Then
MkDir (ruta & "/" & fila1 & "_" & fila2)
End If
End Sub
But a folder with values true_true is created. Any suggestions?