Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am writing a macro to import multiple text files into a spreadsheet. The only part I haven't figured out is how to step sideways, i.e the first text file should use A1 as its origin, the second file C1, the third E1 and so on. Range(A1).Select Range(C1).Select Range(E1).Select /Scott |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think you can do this using the offset property. Eg Range("A1").Offset(0,
2) will take you to Range("C1"). The first argument in the bracket is for rows and the second columns, and you can use negatives to 'move backwards'. I'm very new to VBA so apologies if I am missing your point. "ScottM" wrote: Hi, I am writing a macro to import multiple text files into a spreadsheet. The only part I haven't figured out is how to step sideways, i.e the first text file should use A1 as its origin, the second file C1, the third E1 and so on. Range(A1).Select Range(C1).Select Range(E1).Select /Scott |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sounds interesting Andy. I will try it. Thanks.
Scott "AndyRoo" wrote in message ... I think you can do this using the offset property. Eg Range("A1").Offset(0, 2) will take you to Range("C1"). The first argument in the bracket is for rows and the second columns, and you can use negatives to 'move backwards'. I'm very new to VBA so apologies if I am missing your point. "ScottM" wrote: Hi, I am writing a macro to import multiple text files into a spreadsheet. The only part I haven't figured out is how to step sideways, i.e the first text file should use A1 as its origin, the second file C1, the third E1 and so on. Range(A1).Select Range(C1).Select Range(E1).Select /Scott |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() -- HTH RP (remove nothere from the email address if mailing direct) "ScottM" wrote in message ... Hi, I am writing a macro to import multiple text files into a spreadsheet. The only part I haven't figured out is how to step sideways, i.e the first text file should use A1 as its origin, the second file C1, the third E1 and so on. Range(A1).Select Range(C1).Select Range(E1).Select /Scott |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("A1").Select
Selection.Offset(0,2).Select etc. -- HTH RP (remove nothere from the email address if mailing direct) "ScottM" wrote in message ... Hi, I am writing a macro to import multiple text files into a spreadsheet. The only part I haven't figured out is how to step sideways, i.e the first text file should use A1 as its origin, the second file C1, the third E1 and so on. Range(A1).Select Range(C1).Select Range(E1).Select /Scott |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the assistance. My statement
With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & sDir + "\" & sFileName, Destination:=Range("A1").Offset(0, iPosition)) works fine. Scott "Bob Phillips" wrote in message ... Range("A1").Select Selection.Offset(0,2).Select etc. -- HTH RP (remove nothere from the email address if mailing direct) "ScottM" wrote in message ... Hi, I am writing a macro to import multiple text files into a spreadsheet. The only part I haven't figured out is how to step sideways, i.e the first text file should use A1 as its origin, the second file C1, the third E1 and so on. Range(A1).Select Range(C1).Select Range(E1).Select /Scott |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I import two columns of data and want to delete one of them using my macro.
What is the proper syntax? Scott |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Columns("D:D").Delete
-- HTH RP (remove nothere from the email address if mailing direct) "ScottM" wrote in message ... I import two columns of data and want to delete one of them using my macro. What is the proper syntax? Scott |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
programatically selecting columns to import text into | Excel Discussion (Misc queries) | |||
Selecting Columns | Excel Programming | |||
VBA Range Issue : Cannot programatically select more than 42 columns | Excel Programming | |||
Selecting columns | Excel Programming | |||
Selecting Columns | Excel Programming |