+ Reply to Thread
Results 1 to 2 of 2

calculate dynamic range and autofill formula

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    calculate dynamic range and autofill formula

    Hi

    in the attached I need to join columns A & B. The range can vary from 100 rows to 1000 rows. Is their a macro that can be created to workout how many rows the data takes up and then in the next Colum a formula to join the data together. The macro would auto fill the formula.


    range.xlsx

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: calculate dynamic range and autofill formula

    Try:

    Sub RunMe()
    Dim LR As Long
    
    LR = Range("A" & Rows.Count).End(xlUp).Row
    
    Range("C2").Formula = "=A2&B2"
    
    Range("C2:C" & LR).FillDown
    
    End Sub

+ 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. Autofill using a Macro when range is dynamic
    By CPSmurf in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 09-03-2013, 05:54 PM
  2. VBA Code - Autofill with a Dynamic Range
    By Jurij in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 02:27 AM
  3. Need a macro to autofill a dynamic range
    By missmea2005 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2012, 09:15 AM
  4. Vlookup and autofill a dynamic range
    By ajay1967 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2012, 07:36 PM
  5. Autofill using Dynamic Range (Last Column) and Last Row
    By goldenr2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2011, 11:21 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