View Single Post
  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

I have made a couple of workbooks behaving likely, using workbooks Open
event or macro, but there are limits. The problem is the optimal number of
added rows.

I used Open event for cases, the number of added rows is fixed, i.e. every
week a new row is added to table, or for every active object in some objects
list a new row is added every week. The code checks the last weeknumber in
the table, compares it with current weeknumber/month, and adds row(s) for
every missing week/month.

In another application (working time registration), the number of rows
(depends on number of employees in department) with formulas premade is
determined on SetUp sheet, and after changing the number of rows (it must be
at least equal to their number in employees list) the user can start a macro
which redesigns the sheet. The macro counts existing premade rows and adds
or deletes rows depending the number in SetUp table.

When the number of new rows filled by user isn't limited in any way, there
is a considerable risk, that entries are inserted into unprepared rows (when
there is a possibility, the user can do something in wrong way, he does it)

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Ralph Howarth" wrote in message
...
"Arvi Laanemets" wrote:

...
But in general, usually there is some column in source workbook
having non-empty value whenever there are some data in row. Then you can
easily check it in target workbook. Something like this:
=IF(SourceSheet!A2="","",YourFormula)

The first option is exactly what I am doing with the target worksheet full
of formulas. I simply have a few hundred rows of formulas in the target
worksheet to cover above and beyond the variable number of rows in the

data
source worksheet. I suppose this is the best I can do with formulas.

But the formulas are essentially the same for each cell down a given

column.
The only difference is the row reference changes down the column. It

seems
to me that I could make a macro / VB script that can count the number of

rows
in the dynamic range of the data source worksheet and then write on a

target
worksheet cell by cell, row by row, the results of formulas applied by

VBA.
It seems to me that someone may have already created such automation.

Thanks for your help!