+ Reply to Thread
Results 1 to 9 of 9

Excel VBA Loop Question

  1. #1
    Registered User
    Join Date
    09-07-2018
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2013
    Posts
    4

    Excel VBA Loop Question

    Hi all,
    Trying to do the following steps in order.
    1. write formula(A) into A1
    2. copy A1 and paste value into A1
    3. move to A2
    4. write formula(A) into A2
    5. copy A2 and paste value into A2
    6. move to A3... and so on until A100

    Thanks

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Excel VBA Loop Question

    Hello carcanfloat,

    Welcome to the forum!
    To recap your request you want to replace the formulas in cells A1:A100 with their values, correct?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Excel VBA Loop Question

    You can put the formula in the range you want without any loops
    What formula would you like to put ??

    Generally this is simple example
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  4. #4
    Registered User
    Join Date
    09-07-2018
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Excel VBA Loop Question

    Hi Leith,
    Thank you, looking forward to learning and expanding my Excel skills.

    Yes.

    Here's the formula:

    =COUNTIFS(census!$M$1:$M$272592,B4,census!$K$1:$K$272592,$D$3)

    The starting cell is really D4 and i need it to copy and paste values until D1000.

    I thought that with the COUNTIFS function and the large amount of rows that it's running through, that it would be faster to calculate one cell at a time and copy/paste value.

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Excel VBA Loop Question

    Can you attach sample of your workbook ..?

  6. #6
    Registered User
    Join Date
    09-07-2018
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Excel VBA Loop Question

    I can attach screenshots, would that help?

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Excel VBA Loop Question

    Use my code and change the formula and the range .. and test it ..

  8. #8
    Registered User
    Join Date
    09-07-2018
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Excel VBA Loop Question

    That worked! Thank you!

  9. #9
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Excel VBA Loop Question

    You're welcome. Glad I can offer some help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Loop within a Loop Question
    By vexel77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2013, 11:26 AM
  2. [SOLVED] Do... Loop until question
    By dogster in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2012, 01:44 AM
  3. Excel Loop VBA Question
    By pink705 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2011, 02:31 PM
  4. while loop question
    By Smed in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2008, 12:20 PM
  5. Loop question
    By nuno in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2007, 04:26 AM
  6. Replies: 0
    Last Post: 02-10-2006, 09:00 AM
  7. [SOLVED] Loop question
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-13-2005, 06:05 PM

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