Results 1 to 3 of 3

Convert a fixed function (hard code row number) with embedded functions to last Row Functi

Threaded View

markDuffy Convert a fixed function... 11-05-2013, 10:47 AM
ragulduy Re: Convert a fixed function... 11-05-2013, 10:49 AM
markDuffy Re: Convert a fixed function... 11-05-2013, 12:47 PM
  1. #1
    Forum Contributor
    Join Date
    03-25-2011
    Location
    London, England
    MS-Off Ver
    office 2021
    Posts
    318

    Convert a fixed function (hard code row number) with embedded functions to last Row Functi

    Hi Guys
    London here raining and getting cold.

    Recently I was given some beautiful code from tour colleague Norie. It means the code I enter goes to the last active row. I have been able to use this in other places adjusting the very obvious parts. IE when the circumstances are largely the same. Now they aren't and now I can’t.

    I have code which looks up using sumifs but I have had to enter row 883 which is my current last row. This will not always be the case so I need to have it only looking in the occupied rows.

    Here is the code I have extracted from my VBA sheet
    Range("C7").Select
    ActiveCell.FormulaR1C1 = _
    "=SUMIFS('BDC2'!R2C26:R883C26,'BDC2'!R2C5:R883C5,"">=""&VLOOKUP(R[-1]C,QuarterAccountingDates,3,FALSE),'BDC2'!R2C5:R883C5,""<=""&VLOOKUP(R[-1]C,QuarterAccountingDates,4,FALSE))"
    [/CODE]

    And this is the code from Norie

    Dim LastRow As Long
        With Worksheets("BDC2")
            LastRow = .Range("C" & Rows.Count).End(xlUp).Row
    .Range("b2:b" & LastRow).FormulaR1C1 = "=VLOOKUP(RC[2],AccountTable2,2, FALSE)"
       End With
    They are both in the same Marco but this is now active in the VAT sheet.

    I am uploading the spread sheet as a better explanation.

    Hope someone has a few moments
    Mark
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hard code column number in OFFSET formula
    By maacmaac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2010, 04:13 PM
  2. Hard values to convert to number
    By Guilherme Loretti in forum Excel General
    Replies: 4
    Last Post: 05-09-2006, 06:20 PM
  3. [B]Convert number to fixed length text[/B]
    By BernzG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2005, 06:00 PM
  4. [SOLVED] Date functions-a function to convert day number to mmm-dd?
    By Kirk P. in forum Excel General
    Replies: 2
    Last Post: 04-06-2005, 01:06 PM
  5. [SOLVED] Excel formula randomly changes to hard-code number
    By Ned in forum Excel General
    Replies: 3
    Last Post: 02-14-2005, 08:06 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