Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Fill column macro that stops

I have a speadsheet that has data in column A

I want to have a macro that takes the header from B1 and fills the
rest of column B until the end of data in column A

I currently use this code but it fills too far and I get an error when
I then try and import the file into another application.

Dim X As Range

Set X = ActiveSheet.[B1]
X.AutoFill Destination:=X.Resize(X.End(xlDown).Row, 1)
Range("B1:B10").Select

So in persudo code I suppose its like this

while A != empty
fill B
else
end
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Fill column macro that stops

Just use column A for the row size...
'-----------------------------------
Sub FillTheColumn()
Dim X As Range
Dim XX As Range

Set XX = ActiveSheet.Range("A1")
Set X = ActiveSheet.[B1]

X.AutoFill Destination:=X.Resize(XX.End(xlDown).Row, 1)
Range("B1:B10").Select

Set X = Nothing
Set XX = Nothing
End Sub
'-----------------------------------

Regards,
Jim Cone
San Francisco, CA

"DireWolf" wrote in message
...
I have a speadsheet that has data in column A
I want to have a macro that takes the header from B1 and fills the
rest of column B until the end of data in column A
I currently use this code but it fills too far and I get an error when
I then try and import the file into another application.
Dim X As Range
Set X = ActiveSheet.[B1]
X.AutoFill Destination:=X.Resize(X.End(xlDown).Row, 1)
Range("B1:B10").Select
So in persudo code I suppose its like this
while A != empty
fill B
else
end



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Fill column macro that stops

Thanks Jim, worked a treat.

:)


On Wed, 31 Dec 2003 21:44:49 -0800, "Jim Cone"
wrote:

Just use column A for the row size...
'-----------------------------------
Sub FillTheColumn()
Dim X As Range
Dim XX As Range

Set XX = ActiveSheet.Range("A1")
Set X = ActiveSheet.[B1]

X.AutoFill Destination:=X.Resize(XX.End(xlDown).Row, 1)
Range("B1:B10").Select

Set X = Nothing
Set XX = Nothing
End Sub
'-----------------------------------

Regards,
Jim Cone
San Francisco, CA

"DireWolf" wrote in message
...
I have a speadsheet that has data in column A
I want to have a macro that takes the header from B1 and fills the
rest of column B until the end of data in column A
I currently use this code but it fills too far and I get an error when
I then try and import the file into another application.
Dim X As Range
Set X = ActiveSheet.[B1]
X.AutoFill Destination:=X.Resize(X.End(xlDown).Row, 1)
Range("B1:B10").Select
So in persudo code I suppose its like this
while A != empty
fill B
else
end



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
Opening a file stops a Macro Bob Myers Excel Worksheet Functions 2 January 8th 08 11:50 PM
Macro stops at random places. Jeff Excel Discussion (Misc queries) 0 May 16th 07 02:38 AM
Auto fill drop down stops at second cell CaroleO Excel Discussion (Misc queries) 2 March 22nd 07 01:40 PM
Macro repeats and then stops Sabba Efie Excel Discussion (Misc queries) 2 August 15th 06 11:03 PM
Macro stops when another workbook is open Robert McMahon Excel Programming 1 September 24th 03 10:26 PM


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

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

About Us

"It's about Microsoft Excel"