Incremental Numerial Increase in a Merged Cell

Posted on 2010-01-04
Last Modified: 2013-12-24
I am using the following macro in excel to auto increase a work order number by 1 when the workbook is opened; however, I want to move where the work order number is located in the spreadsheet from cell A1 to a merged cell located at AO4:AR4.  When I change the second line of the macro from ("A1") to (AO4") the macro does not work but instead returns the following error             "Run-time Error '13':
                       Type mismatch

I tried putting replacing A1 with the range A04:AR4, but I get the same error.  I would like to keep this fix very simple if possible by just changing the second line.  Any help would be appreciated.

Sub AutoOpenFunctions()
Selection.Value = Selection.Value + 1
End Sub
Question by:LarryErbe
    LVL 59

    Accepted Solution

    Use this code Rather...

    Sub AutoOpenFunctions()
    Range("Ao4").Value = Range("Ao4").Value+ 1
    End Sub

    Open in new window


    Author Comment

    Perfect!  Thanks for the quick reply as well:)

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
    Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
    Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
    This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now