+ Reply to Thread
Results 1 to 3 of 3

Add formula in cells

  1. #1
    Registered User
    Join Date
    08-22-2012
    Location
    Land of Oz
    MS-Off Ver
    Excel 2000
    Posts
    30

    Add formula in cells

    Hi, y'all. I'm writing a macro for Excel 2003. I need to write a formula, "=IF(S3=""12043"",1,0)", to a cell at "V3", then copy that formula down the "V" column, with the cell referenced in the formula "S3" iterating up ("S4", "S5", "S6", etc), ending at the last row which has data (this row number is set with a variable, "usedrowsagain"). The code I'm using is:

    Please Login or Register  to view this content.
    Can someone explain to me what this code is doing? The result is, it fills in the formula, correctly, but only to row 101. The number of rows it fills in changes as I change the "V10" in the "Range" setting ("V3:V10"), and always fills in ten times as many cells as the "V10", i.e. it fills in 101 if it's set "V10", 181 if it's set "V18", etc. Can someone help me with this? Thanx.
    Last edited by alansidman; 10-01-2014 at 06:06 PM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2508 Win 11
    Posts
    24,940

    Re: Add formula in cells

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    08-22-2012
    Location
    Land of Oz
    MS-Off Ver
    Excel 2000
    Posts
    30

    Re: Add formula in cells

    I found a solution:

    Please Login or Register  to view this content.
    There's supposed to be a button I can click to mark the thread "solved", but I can't find it. Anyone know where it is? Thanx.

+ 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. Replies: 3
    Last Post: 07-26-2014, 06:12 AM
  2. Replies: 1
    Last Post: 03-29-2014, 09:56 AM
  3. Formula needed for dividing 2 sets of cells and excluding adjacent text cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2013, 06:45 PM
  4. Replies: 1
    Last Post: 11-20-2012, 10:08 AM
  5. Formula: Drop Down List -> Choose Option Finds Cells & Replace Cells with Cells
    By g00glethis1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2010, 01:10 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