Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default AutoFill Using a macro

I have a macro that will take the formula that that I have in cell B2 and I
need it to be able to do an autofill for me, any suggestions on how to
accomplish this? So far I have the following code:

Selection.AutoFill Destination:=Range("G2:G50")
Range("G2:G50").Select
Range("G2").Select

I don't want it to always autofill to G50 if I can help it, any suggestions?

Richard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default AutoFill Using a macro

How would the code know how far down you want to fill ? You want to tell it,
or is there a pattern somewhere ?

Best wishes Harald

"Richard" <Richard @discussions.microsoft.com skrev i melding
...
Selection.AutoFill Destination:=Range("G2:G50")


I don't want it to always autofill to G50 if I can help it, any

suggestions?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default AutoFill Using a macro

Wasn't this answered in another thread very recently?


'br = Cells(Rows.Count, "b").End(xlUp).Row
br=33 'or whatever number you like. See Dave's post
Cells(1, "b").autofill Destination:=Range(Cells(1, "b"), Cells(br, "b"))

--
Don Guillett
SalesAid Software

"Richard" <Richard @discussions.microsoft.com wrote in message
...
I have a macro that will take the formula that that I have in cell B2 and I
need it to be able to do an autofill for me, any suggestions on how to
accomplish this? So far I have the following code:

Selection.AutoFill Destination:=Range("G2:G50")
Range("G2:G50").Select
Range("G2").Select

I don't want it to always autofill to G50 if I can help it, any
suggestions?

Richard



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
HELP!!! I need macro to autofill Joe M. Excel Discussion (Misc queries) 4 February 10th 10 07:32 PM
Autofill in macro orquidea Excel Discussion (Misc queries) 5 November 21st 07 11:20 PM
AutoFill Macro [email protected] Excel Programming 8 August 19th 06 02:51 PM
Autofill Macro Hayabusa Excel Programming 1 November 25th 05 05:47 PM
autofill macro glee Excel Discussion (Misc queries) 1 February 14th 05 05:14 PM


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

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"