Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2005, 05:57 AM
Authorized User
 
Join Date: Dec 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Autofilling a column

Hi

I have a spreadsheet imported from the mainframe. There are several columns one of which contains a code e.g "AA" then several hundread blank cells then another code e.g "AB" then several hundread blank cells etc. Is there a way to loop through the column test for what the code is in case it has changed and then autofill the following blank cells with that code?

Cheers
Tony
__________________
Cheers
Tony
 
Old January 4th, 2005, 07:30 AM
Registered User
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sebdanger
Default

I am not sure if this Is any help but this code might help you a bit.

Global a As Integer

Sub Button1_Click()
If a = 0 Then
    a = 1
End If
    Range("a" + Trim(Str(a)), Range("a" + Trim(Str(a))).End(xlDown)).Select
    Range(ActiveCell, ActiveCell.End(xlDown)).Select
    a = Selection.Rows.Count
End Sub
----------------------
a = the number of the row that is selected and nearest to the bottom of the page.

All this does is go from the top cell to the the next cell with somthing in it, and then from that cell down to the next with something in it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofilling or not casrhinos Access 7 June 27th, 2008 07:06 AM
previous column & next column ct Excel VBA 4 August 19th, 2005 04:50 AM
print column by column ct Excel VBA 1 August 8th, 2005 07:21 AM
template column and bound column hidayah ASP.NET 1.x and 2.0 Application Design 1 April 9th, 2005 03:50 PM
Compare two Items of data(in column A and column B ever Excel VBA 6 February 13th, 2004 02:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.