dataoverride Posted September 23, 2009 Posted September 23, 2009 Hi, I'm trying to run a macro which fills data automatically down a worksheet and I keep getting "error 1004 - Filldown method of the range class failed" The Code: Range("F1").Select ActiveCell.FormulaR1C1 = "A" Range("F1:F" + Trim(Str(RCount - 3))).Select Selection.FillDown Any ideas? Cheers, Steve.
dataoverride Posted September 23, 2009 Author Posted September 23, 2009 RCount = Range("A1").SpecialCells(xlCellTypeLastCell).Row
pcstru Posted September 23, 2009 Posted September 23, 2009 RCount = Range("A1").SpecialCells(xlCellTypeLastCell).Row Err ... ok. What exactly did you intend that to do? It's basically that that is throwing things. If you say rcount=10 it will work. Any value below 4 will cause problems.
dataoverride Posted September 23, 2009 Author Posted September 23, 2009 the code itself is exporting a report from SIMS so the rcount is variable depending on the number of fields that are being exported.
pcstru Posted September 23, 2009 Posted September 23, 2009 the code itself is exporting a report from SIMS so the rcount is variable depending on the number of fields that are being exported. If you have a list of values in the first row and you want to know the number of the last column, then the code should be more like : RCount = Range("A1:CZ1").SpecialCells(xlCellTypeLastCell).Column
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now