+ Reply to Thread
Results 1 to 3 of 3

Custom change Macro's Range value, from cells input.

  1. #1
    Registered User
    Join Date
    10-09-2009
    Location
    KL
    MS-Off Ver
    Excel 2003
    Posts
    42

    Custom change Macro's Range value, from cells input.

    The code below works fine, I can copy selected area into new sheet. However, I wish to custom change the Range("A1:AO164") value, for example, at cells(1,1) I key in A1, then cells(1.2) I key in A56, then this changes will reflect to the value in this macro to Range("A1:A56").
    I tried using this way :

    Dim A as string
    cells(1,1).text = a
    cells(1,2).text = b
    Range("a:b").Select

    However, this silly act not working, please help me on this issue, I already run out of idea ~!

    Please Login or Register  to view this content.
    Last edited by Kenji; 10-18-2009 at 12:38 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: Custom change Macro's Range value, from cells input.

    Please Login or Register  to view this content.
    Note also that cells(1,1).text = a should be cells(1,1).Value = a
    BUT: That line would have replaced the contents of Cell A1 with whatever was in variable A.
    In this case A is empty, thus it would have erased the contents of A1!

    Also note that A = Range("A1").Value is read:
    (let) the contents of var A get what's in cell A1.
    But your original said:
    (let) cell A1 get the value stored in var A (it was empty)
    Last edited by protonLeah; 10-17-2009 at 09:40 PM. Reason: slight clarification
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    10-09-2009
    Location
    KL
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Custom change Macro's Range value, from cells input.

    It is work well.
    Thanks a lot ~!!! But I can't find blue button to rate you !@@

+ 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