ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SelectionChange or Defined Name Selection Difference (https://www.excelbanter.com/excel-programming/308200-selectionchange-defined-name-selection-difference.html)

Matt P.[_2_]

SelectionChange or Defined Name Selection Difference
 
Hello,
What I'm trying to do is see how many rows get added to a
list after the dataform inserts records on the list. Tom O
pointed me in the direction of either using defined names
or the Selection Change. I've not been able to use
either. My purpose for doing this is to be able to use
that number of rows that are inserted on that list to
insert that many rows in a particular spot on a summary
sheet and then populate the summary sheet with formulas in
those inserted rows which will then display values.
Basically I just want a summary sheet to do calculations
on newly inserted rows on the list sheet. I need the
number of rows because the summary sheet cannot just
insert the new calculations anywhere it has to insert it
before say a row that has totals at the bottom of that
calculated list.
If anyone has any ideas of how to implement this please
let me know. Thank you.

Matt P.[_2_]

SelectionChange or Defined Name Selection Difference
 
Well I figured it out a way.
Dim lastrow As Long
Dim newlastrow As Long
Dim lstrowdiff As Long

lastrow = ActiveSheet.Cells(Rows.count, "A").End(xlUp).Row
ActiveSheet.ShowDataForm
newlastrow = ActiveSheet.Cells(Rows.count, "A").End
(xlUp).Row

lstrowdiff = newlastrow - lastrow
MsgBox (lastrow)
MsgBox (newlastrow)
MsgBox (lstrowdiff)


I figured that I would put this here incase anyone else
ever need an answer to the question.



-----Original Message-----
Hello,
What I'm trying to do is see how many rows get added to a
list after the dataform inserts records on the list. Tom

O
pointed me in the direction of either using defined names
or the Selection Change. I've not been able to use
either. My purpose for doing this is to be able to use
that number of rows that are inserted on that list to
insert that many rows in a particular spot on a summary
sheet and then populate the summary sheet with formulas

in
those inserted rows which will then display values.
Basically I just want a summary sheet to do calculations
on newly inserted rows on the list sheet. I need the
number of rows because the summary sheet cannot just
insert the new calculations anywhere it has to insert it
before say a row that has totals at the bottom of that
calculated list.
If anyone has any ideas of how to implement this please
let me know. Thank you.
.



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

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