ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Silly I know (https://www.excelbanter.com/excel-programming/288104-silly-i-know.html)

Terry Klein

Silly I know
 
Rather than have 500+ rows that are identical. I thought that a little
VBA script might, as I input data into the next to last row,
automatically copy the last row and add it to the next empty cell/row.

That way it would always be one step ahead of me. This would keep the
workbook to a size that is only as big as it needs to be.

Is this possible?

pikus

Silly I know
 
I don't understand. What are you trying to do? - Piku

--
Message posted from http://www.ExcelForum.com


Terry Klein

Silly I know
 
I am developing a payroll sheet at work. It uses some vlookups for the
employee database as well as the hourly amounts. Each row represents one
employee for that day. The columns include SS#, base rate, O.T, D.T.,etc
and a bunch of others. It also does the calculations and sums at he the
end of each row for that employee.

To make a file that is good for an average week, I may need up to 500
repetitions of this single row. This however makes the file rather large
and some weeks I may not come close to needing that many rows.

To that end I was trying to think of a way that it would auto-copy/paste
additional rows as I near the end.

That way I could have, say 10 rows in the file to begin with and let it
expand according to the needs of that week.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Don Guillett[_4_]

Silly I know
 
Here is one way

Sub newline()
If [e4] < 0 Then [e4] = 0
Cells([checksA].Rows.Count + 7, 1).Select
With ActiveCell
..Offset(0) = .Offset(-1)
..Offset(0, 4) = 1
End With
End Sub

Here's another

Sub newline()
r = Range("b65536").End(xlUp).Row
Range("a" & r & ":h" & r).AutoFill Destination:=Range("a" & r & ":h" & r +
1), Type:=xlFillFormats
Range("e" & r).Copy Range("e" & r + 1)
Range("e" & r + 1) = ""
Range("b" & r + 1) = Date
Range("b" & r + 1).Select
End Sub

--
Don Guillett
SalesAid Software

"Terry Klein" wrote in message
om...
Rather than have 500+ rows that are identical. I thought that a little
VBA script might, as I input data into the next to last row,
automatically copy the last row and add it to the next empty cell/row.

That way it would always be one step ahead of me. This would keep the
workbook to a size that is only as big as it needs to be.

Is this possible?




Don Guillett[_4_]

Silly I know
 
BTW.
"Silly I know" is not a good subject line.
Many won't even bother to look

"New line question" would have been better.


--
Don Guillett
SalesAid Software

"Terry Klein" wrote in message
om...
Rather than have 500+ rows that are identical. I thought that a little
VBA script might, as I input data into the next to last row,
automatically copy the last row and add it to the next empty cell/row.

That way it would always be one step ahead of me. This would keep the
workbook to a size that is only as big as it needs to be.

Is this possible?





All times are GMT +1. The time now is 11:52 PM.

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