+ Post New Thread
Results 1 to 6 of 6
Coding Thread, Excel VBA Issues in Coding and Web Development; Hi, I'm trying to run a macro which fills data automatically down a worksheet and I keep getting "error 1004 ...
  1. #1

    Join Date
    Sep 2009
    Posts
    8
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Excel VBA Issues

    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.

  2. #2


    Join Date
    May 2009
    Posts
    2,914
    Thank Post
    259
    Thanked 770 Times in 585 Posts
    Rep Power
    270
    Where is rcount defined?

  3. #3

    Join Date
    Sep 2009
    Posts
    8
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    RCount = Range("A1").SpecialCells(xlCellTypeLastCell).Row

  4. #4


    Join Date
    May 2009
    Posts
    2,914
    Thank Post
    259
    Thanked 770 Times in 585 Posts
    Rep Power
    270
    Quote Originally Posted by dataoverride View Post
    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.

  5. #5

    Join Date
    Sep 2009
    Posts
    8
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    the code itself is exporting a report from SIMS so the rcount is variable depending on the number of fields that are being exported.

  6. #6


    Join Date
    May 2009
    Posts
    2,914
    Thank Post
    259
    Thanked 770 Times in 585 Posts
    Rep Power
    270
    Quote Originally Posted by dataoverride View Post
    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 :
    Code:
    RCount = Range("A1:CZ1").SpecialCells(xlCellTypeLastCell).Column

SHARE:
+ Post New Thread

Similar Threads

  1. VBA 2003 Ranges
    By CAM in forum Coding
    Replies: 8
    Last Post: 22nd January 2009, 04:40 PM
  2. VBA: Control ID -> function?
    By PiqueABoo in forum Coding
    Replies: 0
    Last Post: 25th November 2008, 03:45 PM
  3. Excel VBA problems
    By cursong in forum Coding
    Replies: 1
    Last Post: 13th October 2008, 11:28 AM
  4. Excel VBA Loop Question
    By vunsev in forum Coding
    Replies: 5
    Last Post: 11th April 2008, 08:08 AM
  5. Cut and paste issues between excel and word
    By 17thcpikeman in forum Windows
    Replies: 1
    Last Post: 30th November 2007, 01:42 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •