Solved

Autofill problem

Posted on 2013-10-29
1
181 Views
Last Modified: 2013-10-29
I am using the below code to Auto-fill but when I ise this on dates the date increases by one day. How do I change this code to copy down without incrementing.

i.e.
15/10/2013 when copied down =
16/10/2013
17/10/2013
etc


With ActiveSheet
        LastR = .Cells(.Rows.Count, "J").End(xlUp).Row
        Range("F2").AutoFill Destination:=Range("F2:F" & LastR)
    End With
0
Comment
Question by:Jagwarman
1 Comment
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 39608232
AutoFill attempts to fill based on a pattern, and with dates Excel assumes you want to increment them.  Try:

With ActiveSheet
    LastR = .Cells(.Rows.Count, "J").End(xlUp).Row
    Range("F2:f" & LastRow) = Range("F2")
End With

Open in new window

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question