+ Reply to Thread
Results 1 to 4 of 4

Continuous Range

Hybrid View

DSC174 Continuous Range 10-10-2005, 09:54 AM
Guest Re: Continuous Range 10-10-2005, 11:05 AM
tad_wegner try this 10-10-2005, 11:11 AM
Guest Re: Continuous Range 10-10-2005, 01:05 PM
  1. #1
    Registered User
    Join Date
    09-26-2005
    Posts
    2

    Exclamation Continuous Range

    Hello,

    OK here is what I am trying to do. I would like to have the macro output to a different cell each time an entry is entered into an input box. My macro has been designed to log the employee's name, clock in time, clock out time, and export that information to a specific cell range. I have all of the macro code in a loop, however, when it starts a second time how would I make it so that is pastes to the cells below what is previously pasted information in? Any help on this problem would be appreciated.

    Thanks,

    Dave

  2. #2
    Tom Ogilvy
    Guest

    Re: Continuous Range

    to find the next open cell in a column of data you can use something along
    the lines of

    set rng = Cells(rows.count,1).End(xlup).offset(1,0)

    In this case, the 1 indicates column 1 (column A), but can be altered.

    If you have a specific range you can use

    set rng = Range("B9:B30").SpecialCells(xlBlanks)
    set cell = rng(1)

    and cell is now a reference to the first blank cell.

    Other than that, you would have to be more specific

    --
    Regards,
    Tom Ogilvy


    "DSC174" <DSC174.1wow6d_1128953119.3373@excelforum-nospam.com> wrote in
    message news:DSC174.1wow6d_1128953119.3373@excelforum-nospam.com...
    >
    > Hello,
    >
    > OK here is what I am trying to do. I would like to have the macro
    > output to a different cell each time an entry is entered into an input
    > box. My macro has been designed to log the employee's name, clock in
    > time, clock out time, and export that information to a specific cell
    > range. I have all of the macro code in a loop, however, when it starts
    > a second time how would I make it so that is pastes to the cells below
    > what is previously pasted information in? Any help on this problem
    > would be appreciated.
    >
    > Thanks,
    >
    > Dave
    >
    >
    > --
    > DSC174
    > ------------------------------------------------------------------------
    > DSC174's Profile:

    http://www.excelforum.com/member.php...o&userid=27553
    > View this thread: http://www.excelforum.com/showthread...hreadid=474745
    >




  3. #3
    Registered User
    Join Date
    10-03-2005
    Posts
    10

    try this

    dave-

    count = Application.WorksheetFunction.count(Range(Cells(9, 15), Cells(18, 15)))
    Cells(9 + count, 15) = "insert your 'output' data"

    you didnt add any specifics so my answer is a little vague, sorry.
    when using the "cells" identifier... cells(row, column).

    typically, (and this is just me) i code these lines slightly differently. when you use "range" or "cells" it is public and works on any worksheet, whichever one is active. if you want it to only work on a specific worksheet you might want to do this...

    a = worksheets("sheet1")

    ...after doing so you can do this...

    a.range(a.cells(9,15), a.cells(18,15))
    a.cells(9 + count, 15) = "insert your 'output' data"

    ...this only works on worksheet("sheet1") now so you can have any worksheet active.

    hope this helps, and isnt too confusing.
    -tad

  4. #4
    Tom Ogilvy
    Guest

    Re: Continuous Range

    Just to add that count counts only cells with numbers. countA might be
    better.

    Also Tad probably meant

    set a = worksheets("Sheet1")

    --
    regards,
    Tom Ogilvy

    "tad_wegner" <tad_wegner.1wp1qe_1128960317.569@excelforum-nospam.com> wrote
    in message news:tad_wegner.1wp1qe_1128960317.569@excelforum-nospam.com...
    >
    > dave-
    >
    > count = Application.WorksheetFunction.count(Range(Cells(9, 15),
    > Cells(18, 15)))
    > Cells(9 + count, 15) = "insert your 'output' data"
    >
    > you didnt add any specifics so my answer is a little vague, sorry.
    > when using the "cells" identifier... cells(row, column).
    >
    > typically, (and this is just me) i code these lines slightly
    > differently. when you use "range" or "cells" it is public and works on
    > any worksheet, whichever one is active. if you want it to only work on
    > a specific worksheet you might want to do this...
    >
    > a = worksheets("sheet1")
    >
    > ..after doing so you can do this...
    >
    > a.range(a.cells(9,15), a.cells(18,15))
    > a.cells(9 + count, 15) = "insert your 'output' data"
    >
    > ..this only works on worksheet("sheet1") now so you can have any
    > worksheet active.
    >
    > hope this helps, and isnt too confusing.
    > -tad
    >
    >
    > --
    > tad_wegner
    > ------------------------------------------------------------------------
    > tad_wegner's Profile:

    http://www.excelforum.com/member.php...o&userid=27770
    > View this thread: http://www.excelforum.com/showthread...hreadid=474745
    >




+ 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