Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Autofill problem

Posted on 2013-10-29
1
Medium Priority
?
210 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 93

Accepted Solution

by:
Patrick Matthews earned 2000 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

604 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