jiura
05-13-2008, 06:02 AM
Hello to all! I have a such problem. I had a table"Production" in witch user can enter production name and price. As I don't know how many items of production has user my program also has a button "Add production". This clear production type situateв in hide row below table.
The proglem is: when my user adds many production types my excel file began to add it slower and slower. I know that the most time borrow this program row:
Selection.Insert Shift:=xlDown
in this VBA code:
Rows(Str(Range("PrZat_PrZatAdd_Start").Row) + ":" + Trim(Str(Range("PrZat_PrZatAdd_Start").Row + 6))).Select
Selection.Copy
Rows(Range("PrZat_PrZatName_End").Row).Select
Selection.Insert Shift:=xlDown
Comment:
a. First two rows select my "clear production" type (1 clear production type consist of 7 rows) and copy it to clibboard
b. Then on row 3: last row in table production selected
c. Then my "clear production" pasted
THe last step "c" is very long and problem if I had a lot of such productions.
How can I add such production faster?
P.S. Calculation type during this code is manual
Application.Calculation = xlManual
The proglem is: when my user adds many production types my excel file began to add it slower and slower. I know that the most time borrow this program row:
Selection.Insert Shift:=xlDown
in this VBA code:
Rows(Str(Range("PrZat_PrZatAdd_Start").Row) + ":" + Trim(Str(Range("PrZat_PrZatAdd_Start").Row + 6))).Select
Selection.Copy
Rows(Range("PrZat_PrZatName_End").Row).Select
Selection.Insert Shift:=xlDown
Comment:
a. First two rows select my "clear production" type (1 clear production type consist of 7 rows) and copy it to clibboard
b. Then on row 3: last row in table production selected
c. Then my "clear production" pasted
THe last step "c" is very long and problem if I had a lot of such productions.
How can I add such production faster?
P.S. Calculation type during this code is manual
Application.Calculation = xlManual