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: 34
Default Autofill & Lookup Function

Hello,

Could someone please help me with the following:

I have started creating an Excel spreadsheet. In column A is a list of
registration numbers. There are many blank cells in column A underneath
each registration number. The number of blank cells underneath each
registration number varies. Sometimes there may be 2 blank cells or 30
blank cells or no blank cells. I have managed to get Excel to locate the
LastCell which has a registration number in it. I used the following
formula for LastCell:

=OFFSET('SA REGISTER'!$A$2,COUNTA('SA REGISTER'!$A$2:$A$20000)-1,0)

I used the following formula for LastCellStockcode:

=OFFSET('SA REGISTER'!$E$2,COUNTA('SA REGISTER'!$E$2:$E$20000)-1,0)

I then used the following macro to get Excel to locate the last registration
number in column A:

Sub Rego_No_Fill()
Range("A2").Select
Application.ScreenUpdating = False
Range("LastCellStockcode").Select
ActiveCell.Offset(0, -4).Range("A1").Select
Range("LastCell").Select
End Sub

So what I would like Excel to do is:

AutoFill from the LastCell (in column A) which has a registration number in
it to the end of the table. To find the end of the table, I use the formula
shown above:

=OFFSET('SA REGISTER'!$E$2,COUNTA('SA REGISTER'!$E$2:$E$20000)-1,0)

For example, if I run the above-mentioned macro, it will locate the last
registration number in my spreadsheet (in column A) and that happens to be
registration number: 556. There are 2 blank cells underneath registration
number 556. I would like Excel to AutoFill those 2 blank cells with the
same registration number of: 556. Thus, all 3 cells in column A will have
the registration number of: 556.

Any help would be greatly appreciated,

Kind regards,

Chris.


 
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
Excel Autofill Function [email protected] Excel Discussion (Misc queries) 1 August 4th 08 11:11 PM
No autofill VLookup function owl37 Excel Worksheet Functions 5 October 12th 06 09:41 PM
How can I isolate a lookup vectors but not values from autofill? rjpeltz Excel Worksheet Functions 2 May 15th 06 07:41 PM
Using the autofill function but increment by certain number in function rishid Excel Worksheet Functions 1 July 14th 05 07:40 PM
INDIRECT Function and Autofill Neil Grantham Excel Worksheet Functions 1 April 21st 05 12:22 AM


All times are GMT +1. The time now is 03:49 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"