+ Reply to Thread
Results 1 to 3 of 3

Increment row by 1

  1. #1
    Registered User
    Join Date
    07-11-2013
    Location
    Cleckheaton, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Increment row by 1

    Hi

    I have just started learning vba & wondering if somebody can show me how to add a simple function to the code i have.
    what i am looking to change is:

    1. Instead of it pasting to row G just paste to the next row

    2. When it pastes it leaves the selection of cells active so you have to click the formula bar

    the code below is what i have so far:

    Sub oldPrice()
    Dim lastCurPrice As Long
    lastCurPrice = Range("D1").End(xlDown).Row
    Range("D2:D68" & lastCurPrice).Copy


    If Not IsEmpty(Range("F2").Value) Then
    Range("G2").PasteSpecial xlPasteValues

    End If

    Range("F2").PasteSpecial xlPasteValues


    End Sub


    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Increment row by 1

    I'm not sure I understand what you mean but I think you want this:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-11-2013
    Location
    Cleckheaton, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Increment row by 1

    That worked perfect. Thank you!

+ 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. [SOLVED] Control Button to increment by 1 and then select next cell in row to increment that cell
    By rammergu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2012, 07:35 PM
  2. Add a day/increment by one
    By alexphys in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2009, 12:48 PM
  3. for every increment of x, add y...?
    By randomblabble in forum Excel General
    Replies: 3
    Last Post: 10-21-2007, 07:11 PM
  4. [SOLVED] increment a value by 1
    By Workshops in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-04-2006, 07:10 PM
  5. Increment/Increment letter in alphabetical order
    By Neil Goldwasser in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2006, 05:10 AM

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