+ Reply to Thread
Results 1 to 4 of 4

Need macro code for filling values in Sheet 2 by taking input parameters from Sheet1

  1. #1
    Registered User
    Join Date
    09-30-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2010
    Posts
    6

    Need macro code for filling values in Sheet 2 by taking input parameters from Sheet1

    Hi All,

    I am new to macro.

    I need a help for the below scenario.
    When we enter the value for the Account number and Service number in Sheet 1, a random number should be generated in Sheet 2 correspondingly.

    PFA the excel showing an example.

    The values in the first row for both Account number and Service number can be random values(can be Integer or String) and the rows below can be incremented.

    Please help me in this regards and let me know if any more input from my side is required.

    TIA.

    Regards,
    Asha
    Attached Files Attached Files

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Need macro code for filling values in Sheet 2 by taking input parameters from Sheet1

    Give this a try

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    09-30-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need macro code for filling values in Sheet 2 by taking input parameters from Sheet1

    Thanks Mike for this help !!

    This code is working fine when I create a New Macro project. But when i try to merge it with my project, its showing 'Run time error:1004' at Sheet2.Range("a1").Resize(n, 2) = arrResults

    One more thing,
    I needed random values for Account Number and Service numbers. It should not be a Constant value.
    And I prefer Integer values to String for both Account Number and Service Number.

    PFA the example i am Searching for.
    Thanks a lot for providing this help !!

    Regards,
    Asha
    Attached Files Attached Files

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Need macro code for filling values in Sheet 2 by taking input parameters from Sheet1

    Change
    Please Login or Register  to view this content.
    to: Replace NameOfDestSheet to you sheet name
    Please Login or Register  to view this content.

+ 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