Insert Row Problem

G

george

Hi,

I am automating Excel using VB6 and I am having a problem inserting a row
(copying row) that contains a simple formula (Sum of two columns). The
inserts is working fine except it is not bringing over the formula. Any
ideas (see code below)?

wbExcel.Sheets(3).Rows(51).Insert

or

Set wr = wbExcel.Sheets(3).Range(A51).EntireRow()
Call wr.Insert(, False)

Thanks
 
J

Jim Cone

Thanks,
Your code inserts a new blank row above row 51.
What was row 51 becomes row 52. Row 52 will contain the formulas.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


Hi,
I am automating Excel using VB6 and I am having a problem inserting a row
(copying row) that contains a simple formula (Sum of two columns). The
inserts is working fine except it is not bringing over the formula. Any
ideas (see code below)?

wbExcel.Sheets(3).Rows(51).Insert

or

Set wr = wbExcel.Sheets(3).Range(A51).EntireRow()
Call wr.Insert(, False)

Thanks
 
J

Jim Cone

In addition...
The xlDown constant should also be qualified with the
ApplicationObjectVariable.
Jim Cone



"Jim Cone" <[email protected]>
wrote in message...
Thanks,
wbExcel.Sheets(3).Rows("15").Copy
wbExcel.Sheets(3).Rows("15").Insert Shift:=xlDown
ApplicationObjectVariable.CutCopyMode = False ' adjust
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



How do I copy row 51 and insert that row above it.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top