+ Reply to Thread
Results 1 to 12 of 12

Dynamic macro

  1. #1
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    329

    Dynamic macro

    Hello.

    I have this macro:

    Please Login or Register  to view this content.
    How can I make this more dynamic the easiest way?

    /Anders

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    How should range("B36") be determined ...?
    HTH
    Carim


    Top Excel Links

  3. #3
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    329
    Please Login or Register  to view this content.
    B36 should be the cell in the column to the right after:
    Please Login or Register  to view this content.
    Does this help?

    /Anders

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,
    Just Insert ...

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    329
    Hello.

    It worked great. Thanks!
    Later in the code I need the information once again.
    I need to change
    Please Login or Register  to view this content.
    to a dynamic version like this i guess.
    Please Login or Register  to view this content.
    What is wrong? Excel tells me "Expected list separator or )"

    /Anders

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    The error is in the location of the "

    should be

    Please Login or Register  to view this content.
    NEver use a $ symbol on a variable that is to hold numeric information. The $ symbol changes the variable to a string variable

  7. #7
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    329
    Thank you.

    How about this one?

    Range("A36:T36").Select

    How do I make it dynamic?
    Range ("A"&i:T"&i).Select

    /Anders

  8. #8
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    329
    Thank you both!

  10. #10
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Glad you fixed your problems ...

    Thanks for the feedback

  11. #11
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    I am also Glad you fixed your problems ...

    Thanks for the feedback

  12. #12
    Registered User
    Join Date
    07-18-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    3

    Re: Dynamic macro

    Hi,

    Could you please tell me where do you add or replace the above code in the source code.
    I am trying but it doesnot work.

    Thanks

+ 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