Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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.misc
|
|||
|
|||
![]()
Scott
Use Offset(rownum, columnnum) to move the activecell. ActiveCell.Offset(0, 2).Select Rarely necessary to select anything. Example........Instead of Dim actSht As Worksheet Set actSht = ActiveSheet Worksheets("Sheet2").Activate Range("A1:J10").Select Selection.Copy actSht.Activate Range("K43").Select ActiveSheet.Paste use Worksheets("Sheet2").Range("A1:J10").Copy _ Destination:=ActiveSheet.Range("K43") Gord Dibben Excel MVP On Thu, 24 Nov 2005 15:19:48 -0500, "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.misc
|
|||
|
|||
![]()
Thanks for the feedback.
Scott "Gord Dibben" <gorddibbATshawDOTca wrote in message ... Scott Use Offset(rownum, columnnum) to move the activecell. ActiveCell.Offset(0, 2).Select Rarely necessary to select anything. Example........Instead of Dim actSht As Worksheet Set actSht = ActiveSheet Worksheets("Sheet2").Activate Range("A1:J10").Select Selection.Copy actSht.Activate Range("K43").Select ActiveSheet.Paste use Worksheets("Sheet2").Range("A1:J10").Copy _ Destination:=ActiveSheet.Range("K43") Gord Dibben Excel MVP On Thu, 24 Nov 2005 15:19:48 -0500, "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Text import wizard defaults? | Excel Discussion (Misc queries) | |||
Import comma delimited text | Excel Discussion (Misc queries) | |||
Excel Text Import Wizard | Excel Discussion (Misc queries) | |||
import data to specific columns | Excel Discussion (Misc queries) | |||
VBA Import of text file & Array parsing of that data | Excel Discussion (Misc queries) |