Solved

Autofill problem

Posted on 2013-10-29
1
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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 article describes a serious pitfall that can happen when deleting shapes using VBA.
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 demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

691 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