+ Reply to Thread
Results 1 to 5 of 5

How to reference every nth cell in a column

  1. #1
    Registered User
    Join Date
    02-12-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    32

    How to reference every nth cell in a column

    Helo,

    I have a data entry spreadsheet that contains 120 data entry panels each of 10 rows. Each panel is separated by 3 rows (1 of which is hidden). When entering data to the panel the user is required to enter a date in column F of the data entry panel. The number of used rows in each data entry panel can vary from 1 to 10.

    The entry of a date in the first Column F cell in each entry panel stamps today's date in Col F in the first row below each data panel (the hidden row) and that date is then linked to a separate summary sheet to show the date of data entry. The code I'm using for the date stamping routine is below, and although it works it is painfully slow and I'm sure very inefficient. I've had to break the code into the three sections as shown below because there seems to be a limit to the number of individual cells I can reference in each of the range statements. (Is there a limit or is the length of the range statement causing some other problem?)

    My vba skills are still pretty limited and I can't crack a way to make this code faster/better/more efficent. Can anyone assist with changes to the code below to reference every 13th cell rather than list each 13th cell separately as I've done? Any help will be greatly appreciated.

    Please Login or Register  to view this content.
    Last edited by glenin; 08-26-2009 at 10:10 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to reference every nth cell in a column

    Try this (untested):
    Please Login or Register  to view this content.
    Last edited by shg; 08-26-2009 at 07:45 PM. Reason: disable events
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-12-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: How to reference every nth cell in a column

    shg,

    Thank you very much - works perfectly.

    If you have a chance would you please let me know what the 'Mod 13 = 0' part of the code is doing.

    Thanks again.

    Regards

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to reference every nth cell in a column

    it computes the row number modulo 13, which is zero for every 13th row.

  5. #5
    Registered User
    Join Date
    02-12-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: How to reference every nth cell in a column

    Thank you again - I keep realising that the more I learn about this vba stuff the less I know!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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