+ Reply to Thread
Results 1 to 3 of 3

Autofill Data using relative refernces

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    2

    Question Autofill Data using relative refernces

    Hi all,

    I am trying to use a 'find function' to find a date in row 5, and under that date enter a formula into all cells down to the lastrow. Here is my code below,

    Please Login or Register  to view this content.

    The issue I am having is this part,
    Range("g6:g6").Select
    Selection.AutoFill Destination:=Range("g6:g" & Lastrow), Type:=xlFillDefault

    I need this part to be relative to the column and cell that is currently active not column G.
    When I find the date (which btw is what the 'Sheets("Imports").Range("a1")' is), I then want to add the formula in all cells below this date until the lastrow.

    I hope this makes sense, please ask any questions if you need to

    Thanks in advance!
    Nick

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Autofill Data using relative refernces

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    09-23-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    2

    Re: Autofill Data using relative refernces

    AlphaFrog, you are a legend! Thanks so much!

+ 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 with relative reference
    By bimo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2014, 06:15 AM
  2. Problem adjusting macro for different cell refernces
    By toph1903 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2013, 08:41 AM
  3. Excel 2007 : Find & Replace cell refernces
    By MiserableLawStdnt in forum Excel General
    Replies: 1
    Last Post: 10-10-2011, 12:18 PM
  4. Autofill from a relative range
    By glennchung in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-01-2010, 01:44 PM
  5. Autofill Relative Equation Across Sheets
    By abcd12 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2008, 03:27 PM
  6. Relative Reference and AutoFill- Macro
    By Andy Roberts in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-27-2005, 11:05 PM
  7. [SOLVED] Relative reference autofill increment other than +1
    By SteveB in forum Excel General
    Replies: 3
    Last Post: 06-14-2005, 03:05 PM

Tags for this Thread

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