Macro

k209310

Active Member
Joined
Aug 12, 2002
Messages
382
I have the following macro

Sub Insert()
With ActiveCell.EntireRow
.Insert
.Cells(1, 15).Copy .Cells(0, 15)
.Cells(1, 19).Copy .Cells(0, 19)
.Cells(1, 20).Copy .Cells(0, 20)
.Cells(1, 21).Copy .Cells(0, 21)
.Cells(1, 22).Copy .Cells(0, 22)
.Cells(1, 23).Copy .Cells(0, 23)
.Cells(1, 24).Copy .Cells(0, 24)
.Cells(1, 27).Copy .Cells(0, 27)
.Cells(1, 28).Copy .Cells(0, 28)
.Cells(1, 29).Copy .Cells(0, 29)
.Cells(1, 31).Copy .Cells(0, 31)
.Cells(1, 32).Copy .Cells(0, 32)
.Cells(1, 33).Copy .Cells(0, 33)
.Cells(1, 34).Copy .Cells(0, 34)
.Cells(1, 35).Copy .Cells(0, 35)
.Cells(1, 36).Copy .Cells(0, 36)
End With
End Sub

The macro allows a past function to insert a line in to a table along with any formula.

The macro works fine until.
.Cells(1, 31).Copy .Cells(0, 31)
.Cells(1, 32).Copy .Cells(0, 32)
.Cells(1, 33).Copy .Cells(0, 33)
.Cells(1, 34).Copy .Cells(0, 34)
.Cells(1, 35).Copy .Cells(0, 35)
.Cells(1, 36).Copy .Cells(0, 36)

when from cell 31 onwards no formula are pasted in to the new row.

Any ideas??
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

rikrak

Active Member
Joined
Aug 21, 2002
Messages
255
You are sure that there a formula's to copy?
You get no errors when running the macro?
 

k209310

Active Member
Joined
Aug 12, 2002
Messages
382
There are deffinatly formulas there. I am also pretty sure that the numbers are corect for the cells that they are referencing. all of the formulas copy until collum AK when they seem to just stop.
This message was edited by k209310 on 2002-08-29 03:14
 

rikrak

Active Member
Joined
Aug 21, 2002
Messages
255
Because no other boarduser comes with a solution I think it's not a common problem.

I tried your macro and had no problems.

Have you tried debugging by stepping trough the macro and see what happens?

Did you run the macro on another sheet/workbook?
 

k209310

Active Member
Joined
Aug 12, 2002
Messages
382
There is no problem with the macro. But i`ve solved the other problem and the macro still doesnt work. So it had nothin to do with that.
 

Forum statistics

Threads
1,148,525
Messages
5,747,203
Members
424,068
Latest member
Salim khamis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top