Solved excel macro is no longer working

July 11, 2016 at 10:53:37
Specs: Windows 64
I have been using a macro in my excel spread sheet for a year. it usually updates the formula to the next row cells but now it is just adding the rows and not the formula. How would I repair this if I didnt create the macro or why has it stopped working

See More: excel macro is no longer working

Report •


✔ Best Answer
July 12, 2016 at 09:00:29
First thing that comes to mind is to make sure you still have formulas in the row to be copied.

How big is your spread sheet?

I haven't tested the macro extensively, but it should keep adding rows till you hit the bottom of the sheet at row number 1,048,576

MIKE

http://www.skeptic.com/



#1
July 11, 2016 at 12:17:41
Without seeing the Macro it is difficult to determine what the problem is.

Please read this HOW-TO which explains the use of < PRE > tags

http://www.computing.net/howtos/sho...

Then post the macro and hopefully we'll be able to help.

MIKE

http://www.skeptic.com/


Report •

#2
July 11, 2016 at 12:26:55
    Rows("2:4").Select
    Range("A4").Activate
    Selection.EntireRow.Hidden = False
    Rows("3:3").Select
    Selection.Copy
    Rows("4:4").Select
    Selection.Insert Shift:=xlDown
    Application.CutCopyMode = False
    Rows("3:3").Select
    Selection.EntireRow.Hidden = True
End Sub


Report •

#3
July 11, 2016 at 14:55:01
Is this part of a larger macro?
I'm no expert but it looks like parts are missing.

MIKE

http://www.skeptic.com/

message edited by mmcconaghy


Report •

Related Solutions

#4
July 11, 2016 at 16:41:52
I ran your macro and it seems to work.
It hides row 3, inserts a new row and copies & updates the formulas.

Unless I'm missing something.

MIKE

http://www.skeptic.com/


Report •

#5
July 12, 2016 at 06:44:30
that is what the macro is intended to do. I run it in the spread sheet and it will add the rows but the formulas are not being added. I am trying to figure out what made the macro stop if my spread sheet outgrew the macro do i need to delete some data or if any solution is out there as to why the formula is not being added to the new rows.

Report •

#6
July 12, 2016 at 09:00:29
✔ Best Answer
First thing that comes to mind is to make sure you still have formulas in the row to be copied.

How big is your spread sheet?

I haven't tested the macro extensively, but it should keep adding rows till you hit the bottom of the sheet at row number 1,048,576

MIKE

http://www.skeptic.com/


Report •

#7
July 12, 2016 at 09:16:55
Yes, the formula is in the copied row I am only in 7992KB.

Report •

#8
July 12, 2016 at 09:53:32
Just like MIke, I am not having any trouble copying the formulas from Row 3 to a "new" Row 4.

In addition, this appears to be a recorded macro. Quite often, a recorded macro produces code that is bloated and inefficient. For example, there is no need to "Select" an object in VBA in order to perform an action on it and there is no need to unhide a Row just to copy it.

As far as I can tell, this code does the same thing as the code that you posted, but
without all the extra (and unnecessary) steps.

4 instructions instead of 10

Sub Copy3To4()
    Rows("3:3").Copy
    Rows("4:4").Insert Shift:=xlDown
    Rows("4:4").EntireRow.Hidden = False
    Application.CutCopyMode = False
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#9
July 12, 2016 at 10:30:51
What else is going on in the worksheet, any other macros?
Anything added below the bottom row that might cause a problem?

MIKE

http://www.skeptic.com/


Report •

#10
July 12, 2016 at 11:24:48
It might help if you singled step through the code to see what is going on. It's often very hard to troubleshoot a macro just by running it and observing the outcome.

Please check out this tutorial, specifically the section on Single Stepping:

http://www.computing.net/howtos/sho...

message edited by DerbyDad03


Report •

#11
July 13, 2016 at 07:20:38
thanks for checking the macro for me. once i was informed it worked it must be the formula missing from the fields. I just deleted a few rows and then ran the macro to copy the all data in fileds. finally deleted all manual data and ran the macro and now it is working again.

Report •

Ask Question