ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Fill Macro II (https://www.excelbanter.com/excel-worksheet-functions/219492-fill-macro-ii.html)

Mike

Fill Macro II
 
Below is my earlier question.. My new problem is that the autofill command
doesn't seem to work when the selected area is two-dimensional. For example,
if I want to take several adjacent cells in a row and fill them down, the
macro crashes. I'm wondering if I should try using a "FillDown" command
rather than AutoFill. I think this can definitely be done, but I'm not sure
what the parameters of the command would be... Any thoughts? (I'd like to
create a macro to do fill right in this case, too.)

Thanks!

Actually, try this, after selecting the cell to copy, and the area that you want to fill in:

Sub FillDownSelection()
Selection(1).AutoFill Destination:=Selection, Type:=xlFillValues
End Sub

HTH,
Bernie
MS Excel MVP


"Mike" wrote in message
...
Is there a way to design a macro that can perform the 'fill down without
formatting' procedure for cells that I highlight? I've tried to write it but
it busts if I select a different number of cells that I used when I recorded
it. Thanks for the help!




All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com