ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Continuous Range (https://www.excelbanter.com/excel-programming/342359-continuous-range.html)

DSC174[_2_]

Continuous Range
 

Hello,

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

Thanks,

Dav

--
DSC17
-----------------------------------------------------------------------
DSC174's Profile: http://www.excelforum.com/member.php...fo&userid=2755
View this thread: http://www.excelforum.com/showthread.php?threadid=47474


Tom Ogilvy

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" wrote in
message ...

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




tad_wegner[_8_]

Continuous Range
 

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 slightl
differently. when you use "range" or "cells" it is public and works o
any worksheet, whichever one is active. if you want it to only work o
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 an
worksheet active.

hope this helps, and isnt too confusing.
-ta

--
tad_wegne
-----------------------------------------------------------------------
tad_wegner's Profile: http://www.excelforum.com/member.php...fo&userid=2777
View this thread: http://www.excelforum.com/showthread.php?threadid=47474


Tom Ogilvy

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" wrote
in message ...

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





All times are GMT +1. The time now is 12:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com