PC Review


Reply
Thread Tools Rate Thread

Automating Tasks

 
 
keith
Guest
Posts: n/a
 
      12th Mar 2007
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 With Quote
 
 
 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      12th Mar 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating AD tasks =?Utf-8?B?WGF2aWVy?= Microsoft Windows 2000 Active Directory 1 13th May 2005 10:00 AM
Automating some tasks Justin C Microsoft Excel Misc 0 27th Apr 2005 12:45 PM
Re: Automating Tasks Ron Hinds Microsoft Access 0 15th Jan 2004 12:30 AM
Automating Tasks Microsoft Access 0 14th Jan 2004 05:19 PM
Re: Automating Tasks Douglas J. Steele Microsoft Access 0 14th Jan 2004 04:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:41 PM.