LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default macro with variable rows

I am working with a table which was exported from Quickbooks and I am trying
to prepare it using a macro and then copy it into an access table.

The columns for the data are always the same, the go from A to J, but the
number of rows vary.
A is blank, because I need this blank field for the autonumber field in
access.
I do not know much about macros, so I so I use the build in record the macro
using relative addresses. But somehow, excel always puts some absolute
address into it.

Windows("gltrans.xls").Activate
ActiveWindow.WindowState = xlNormal
ActiveWindow.WindowState = xlNormal
Range("B1:B2").Select
Selection.EntireRow.Delete
Columns("E:E").Select
Selection.TextToColumns Destination:=Range("E1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(4, 9)),
TrailingMinusNumbers:=True
Columns("F:F").Select
Selection.TextToColumns Destination:=Range("F1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(4, 9)),
TrailingMinusNumbers:=True
Range("B2").Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.End(xlDown).Select
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 7).Range("A1").Select

This macro stops at J2663 - which this week it the last cell
How do I highlight the A2 to J2663 without putting any relative addresses in
it.
Annelie



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I autodelete rows in a macro on a variable dataset? bimpnottin_noregard Excel Discussion (Misc queries) 6 January 29th 09 06:19 PM
Macro for variable rows (fruit flies) Lisa Anne Excel Discussion (Misc queries) 2 July 2nd 08 12:20 PM
Macro for copying a value to a variable no. of rows Ian Grega Excel Discussion (Misc queries) 6 April 15th 08 02:48 PM
sum and variable rows Jim Excel Worksheet Functions 4 September 7th 05 07:48 PM
Selecting rows with variable Jim[_24_] Excel Programming 7 September 16th 03 02:03 PM


All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"