Ver Mensaje Individual
  #6 (permalink)  
Antiguo 27/08/2007, 15:04
Avatar de abrahamvj
abrahamvj
 
Fecha de Ingreso: julio-2006
Ubicación: Lima, Peru
Mensajes: 708
Antigüedad: 17 años, 9 meses
Puntos: 18
Re: Duda para generar un txt con un macro

Fijate en este ejemplo:


Sub Txtdatos()

Dim valor() As Variant

[a1].Select

If ActiveCell = Empty Then GoTo saltar

Open "C:\Datos.txt" For Append As 1

regresar:

valor = Array(ActiveCell, ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 2), ActiveCell.Offset(0, 3), _
ActiveCell.Offset(0, 4), ActiveCell.Offset(0, 5), ActiveCell.Offset(0, 6))

Print #1, valor(0), valor(1), valor(2), valor(3); _
valor(4), valor(5), valor(6)

ActiveCell.Offset(1, 0).Select

If ActiveCell = Empty Then GoTo saltar

GoTo regresar:

saltar:

Close #1

End Sub

Abraham