+ Reply to Thread
Results 1 to 11 of 11

Fill cells with formula, one by one, AutoFill?

  1. #1
    Registered User
    Join Date
    02-11-2012
    Location
    Munich
    MS-Off Ver
    Excel 2003
    Posts
    6

    Fill cells with formula, one by one, AutoFill?

    Hello,
    can anyone tell me how I can fill out the cells of a column with a formula (please bear with me if I make any mistakes, English is not my native language. Thanks)

    I have a table with thousands of data sets. The last 3 columns X Y Z are filled with formulas.

    The problem is that every recalculation requires a few seconds. So, my idea was to write the formula only in the first row in the respective colums and fill every single cell by VBA one by one. The formula in the respective previous cell should be converted into value. I'm not sure but I think the less formula there are in the Sheet the faster it works.

    After that the second, and finally the last column should be filled like this.

    Is there any solucion for my problem?

    I thought to do it with For...Next but I didn't manage it.

    By the way, I am not really new in VBA and I find my way in the Editor and I am familiar with the syntax. But I can't write my own code yet.

    Many thanks for your help


    conf

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Fill cells with formula, one by one, AutoFill?

    Try this.

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Fill cells with formula, one by one, AutoFill?

    I can't see how using VBA would be quicker. Switch Calculation to manual, then re-calculate only when you need to
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    02-11-2012
    Location
    Munich
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill cells with formula, one by one, AutoFill?

    Hello JapanDave,
    thanks for your reply. It works excellently.

    But unfortunately this is not what I was looking for. I wanted to caculate every cell individually because the Array Formula require some time to calculate each time when it starts calculating.


    With your code it takes the same time as I would fill it manually.

    Do you have any further idea?

    Thank you for your help!

    conf

  5. #5
    Registered User
    Join Date
    02-11-2012
    Location
    Munich
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill cells with formula, one by one, AutoFill?

    Hello Roy,
    I'm not sure but I think it would be faster if there is only one cell with a formula inside. The results in the colums of the respective row depend on each other.

    I can't upload it, the data are quite sensitiv.

    Thanks for your reply.

    conf

  6. #6
    Registered User
    Join Date
    02-11-2012
    Location
    Munich
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill cells with formula, one by one, AutoFill?

    Ah, I forgot to mention that sometimes the application hang during calculation. I think this happens because of the CPU-intensive formula.

  7. #7
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Fill cells with formula, one by one, AutoFill?

    Post a workbook if you can?

  8. #8
    Registered User
    Join Date
    02-11-2012
    Location
    Munich
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill cells with formula, one by one, AutoFill?

    Here you are, it's a simple copy of my sheet. Imagina how long it will work if you have thousands of rows and a plenty of columns to calculate.
    Attached Files Attached Files

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Fill cells with formula, one by one, AutoFill?

    llThat number of array formulas will be slow. You can switch calculation to manual, then when necessary just calculate a specific cell or range or range of cells

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    02-11-2012
    Location
    Munich
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill cells with formula, one by one, AutoFill?

    Thanks Roy,
    I have to go on looking for another way. Thanks all for your effort!

    Have a nice day!

    conf

  11. #11
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Fill cells with formula, one by one, AutoFill?

    Why don't you simply sort your sheet ? first A, second B, third D ?



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1