Solved

Autofill problem

Posted on 2013-10-29
1
161 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macro to determine Text Replacement 17 38
Input Macro 8 22
SUMIFS with a criteria that could be in multiple rows 21 31
increment numbers by 10 11 26
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now