+ Reply to Thread
Results 1 to 5 of 5

Row incrementing

Hybrid View

  1. #1
    Registered User
    Join Date
    07-02-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    5

    Row incrementing

    Hey everyone,

    I have an excel macro that is getting the better of me. What I am trying to accomplish is when I click the submit button on file A it writes to a different workbook. That part currently works, however it overwrites the same cell each time. I need it to start in Column D2 for example. Once that field is populated, the next time something should be written should populate in field D3, then D4 and so on. I was looking into using the Offset and x1down commands but cannot get them working correctly. Any help on this would be greatly appreciated. Thank you.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Row incrementing

    attach please a sample file with your macro
    If solved remember to mark Thread as solved

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Row incrementing

    Maybe:

    
    Range("D" & rows.count).End(3)(2)

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Row incrementing

    You can search for last row each time:

         Dim wkB As Workbook
        Dim LastRow As Long
    LastRow = wkB.Sheets("Sheet1").Range("A65536").End(xlUp).Row
    And then write your data in for example
    Range("D" & LastRow +1)

  5. #5
    Registered User
    Join Date
    07-02-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Row incrementing

    Thanks everyone for the replies. I got pulled off of this and into other things, hence my absense. The higher ups have taken a different direction on this and I don't need to implement this, however it may be handy in the future. Thanks again.

+ 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. incrementing one value by another
    By danielseward408 in forum Excel General
    Replies: 4
    Last Post: 08-26-2012, 04:15 AM
  2. Hex incrementing
    By jsamuelshn in forum Excel General
    Replies: 11
    Last Post: 11-01-2010, 08:56 PM
  3. Incrementing
    By Odisey in forum Excel General
    Replies: 4
    Last Post: 10-10-2008, 11:42 AM
  4. Incrementing by more than one row
    By peaviner in forum Excel General
    Replies: 3
    Last Post: 09-12-2006, 11:11 AM
  5. [SOLVED] Next not incrementing
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-19-2005, 10:06 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