+ Reply to Thread
Results 1 to 7 of 7

Problem with name in the macro code

  1. #1
    Registered User
    Join Date
    03-31-2012
    Location
    Warszawa
    MS-Off Ver
    Excel 2013
    Posts
    32

    Problem with name in the macro code

    I added fourth variable and can not be set name for G. How to do it?

    I've increased the range:
    . Range ("B15: B18")

    It takes G directly below Z
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Problem with name in the macro code

    I run your code and have not get any error. I do not know where the G is in your code and I also do not know what is missing from your code. Need to explain what you wish to add to your code.

  3. #3
    Registered User
    Join Date
    03-31-2012
    Location
    Warszawa
    MS-Off Ver
    Excel 2013
    Posts
    32

    Re: Problem with name in the macro code

    In table Z The G is in cell B24 should be in B27

    I've got an advice to look what is in part when i = 1 or 2, and what is missing when i = 3

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Problem with name in the macro code

    Please Login or Register  to view this content.
    You are increasing the next empty row by 1 and will end in 24.
    Consider changing the variable byte in to integer. Byte takes 8 memo only, so when you loop and exceed 8, you will get an overflow error
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-31-2012
    Location
    Warszawa
    MS-Off Ver
    Excel 2013
    Posts
    32

    Re: Problem with name in the macro code

    I've fixed it. (If u want pls find attachment)

    And what about changing the variable byte into integer.

    Avoiding an overflow error depends on the factors: how long is macro, how many used a variables in the code? how measured it?
    8 memo is enough for this macro?

    What are weakness of integer? Could u briefly explain me.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Problem with name in the macro code

    A Byte holds a memory of 8 characters. When you loop through, if you exceed 8 looping, you will get an error.
    Integer can hold 32867,so you can loop through 32867. Yes, sometimes it is good practice to assign a variable to a small memory so as to freed up memory, but byte is nothing something any one can recommend. I myself always use long variable, so that if my spread sheet is so large and holds more than 32867 lines, I would be on the safe side that my code will not fail.
    In my opinion, it would be good practice to use LONG as variable

  7. #7
    Registered User
    Join Date
    03-31-2012
    Location
    Warszawa
    MS-Off Ver
    Excel 2013
    Posts
    32

    Re: Keep formula after used macro

    I have one more question

    How to keeps a formula?
    After used macro the formula bar (table Z) is get lost. Formulas in table Z shows a source date from e.g. 2010, 2011, 2012
    Is it possible to keep it ?
    Last edited by jpol; 03-23-2013 at 07:49 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1