Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automating Tasks

Hi,

I'm trying to automate some tasks to run on a data set that is
imported in Excel via SQL.

I recorded a macro that Autofills a formula down through the set of
data, however I don't know how to deal with a variable number of rows
within the data.
The macro was recorded on a small sample set, (approx 400 rows) but
when I then tried the full data set it was closer to 40000 rows.

Looking at the code I find this code snippit:
Selection.AutoFill Destination:=Range("I2:I431"), Type:=xlFillDefault

Is there a way in which in which I can autofill to the extent of the
data in, say, column B?

TIA
Keith

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Automating Tasks

The line below will return the last used row in a range.

LastRowColB = Range("B65536").End(xlUp).Row

"keith" wrote:

Hi,

I'm trying to automate some tasks to run on a data set that is
imported in Excel via SQL.

I recorded a macro that Autofills a formula down through the set of
data, however I don't know how to deal with a variable number of rows
within the data.
The macro was recorded on a small sample set, (approx 400 rows) but
when I then tried the full data set it was closer to 40000 rows.

Looking at the code I find this code snippit:
Selection.AutoFill Destination:=Range("I2:I431"), Type:=xlFillDefault

Is there a way in which in which I can autofill to the extent of the
data in, say, column B?

TIA
Keith


Reply
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
Counting tasks slavenp Excel Discussion (Misc queries) 0 August 6th 09 04:16 PM
Counting tasks slavenp Excel Discussion (Misc queries) 0 July 29th 09 04:48 PM
Exporting tasks se7098 Excel Worksheet Functions 2 January 21st 09 03:37 PM
Too many client tasks? rml Excel Discussion (Misc queries) 0 July 19th 06 05:41 PM
Automating some tasks Justin C Excel Discussion (Misc queries) 0 April 27th 05 12:45 PM


All times are GMT +1. The time now is 11:01 AM.

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"