Results 1 to 3 of 3

Add formula in cells

Threaded View

  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:

    With Sheets("BOM")
            .Range("V3:V10" & .Cells(usedrowsagain).End(xlUp).Row).Formula = "=IF(S3=""12043"",1,0)"
        End With
    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

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