+ Reply to Thread
Results 1 to 16 of 16

Change cell value

  1. #1
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Change cell value

    Hi,

    i am having a two sheets(Sheet1 and Sheet2) in my workbook. i want to change cell (C5) value in sheet 1 with column from Sheet2 (A5:A30).

    I want to right vba code like, if i click on a command button, cell value of C5 in sheet1 changes with cell value in column_A (Range A5:A30) on a one run. i tried different way to right a code but it's not working. In simple, way i want to run a loop who change C5 value in sheet1 with values in column_A (A5:A30).

    thanks,

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: Change cell value

    Your explanation is a little confusing. Tell me how you will determine which cell in Range A5:A30 on Sheet 2 will correspond to the be the value on Sheet 1 in Cell C5. We need more information. For instance your logic to make this happen. Talk to us as if we were standing in line for coffee at Starbucks and explain your situation.

    Your saying you tried a way but is not working does not help. We cannot read your mind or know what you tried. Help us to help you by telling the whole story. Attach a worksheet to make the explanation easier. I am sure it is clear in your mind, but you've fuzzied mine up.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Change cell value

    Please Login or Register  to view this content.
    Last edited by Solus Rankin; 02-27-2014 at 05:24 PM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  4. #4
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Change cell value

    sorry about my thread. i should send a sample file with that...

  5. #5
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Change cell value

    Please find attached sample of my thread
    Attached Files Attached Files

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Change cell value

    Book2(1).xlsm Attached.

  7. #7
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Change cell value

    in above sample, what i want is?

    I want to right a loop on command button, click event.

    which change sheet1 C2(Highlighted Cell) value with values on sheet 2 in column A (A5:A34).

    I hope this make sense what i am looking for....

  8. #8
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Change cell value

    Hi Solus,

    Thanks for your efforts much appriciated

    but i want ro change values in one run.

    like in attached file i have to click on command button everytime to change the value.

    but i want to click on once and it changes values until loop o reached on A34 sheet2.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: Change cell value

    Your explanation is still not making any sense. Please explain the simple logic of what this button is to do. Step by step. What is the criteria that will put what value in the highlighted cell. Give us a realistic example. If you want a loop, then explain what the loop is looking for.

  10. #10
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Change cell value

    It sounds like you want to spin through all those values like a slot machine, displaying each in C2 for a given amount of time.

  11. #11
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Change cell value

    Hi Alan,

    I don't know if it's possible or not what i am trying to achive.

    ok

    what i want is:

    Step one: when i click on command button.

    it run a loop and pulls values on sheet2 in column A to cell C2 on sheet1.

    i want to loop starts from first value in column A (A5) from sheet2 and ends on A34.

    each time loop change C2 value with the next value in column A...

    for example:

    when i click on command button

    loop will start
    and it will pulls

    Afghanistan from A5 (sheet2) to cell C2 on sheet1 then
    Albania from A6 (sheet2) to cell C2 on sheet1..... so on up to Burundi (which is on A34 sheet2)

    on a single click

  12. #12
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Change cell value

    So

    this is not possible. is this what you are trying to say?

  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: Change cell value

    Why would you want to do that. Each time you loop through a name using a macro, it will replace the prior name. It will cycle through so fast you will not see anything except the last item. It will happen in less than one second. I don't understand your thinking or rationale. Why not just select the last item.

  14. #14
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: Change cell value

    Here is what you asked for, but I don't understand the need.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Change cell value

    Hey Alan,

    you are a star man

    you solve my problem.. many thanks to you

  16. #16
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: Change cell value

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. auto change cell formula on condition of worksheet change in other cells
    By futurejock in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-01-2009, 12:11 AM
  2. Change Event doesn't change until I return to the Target Cell
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-11-2007, 05:20 PM
  3. [SOLVED] making copied cells change with change in original cell
    By Jennifer Mcdermeit in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2006, 11:58 AM
  4. [SOLVED] Cell value change to trigger macro (worksheet change event?)
    By Neil Goldwasser in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2006, 10:00 AM
  5. [SOLVED] Change workbook sheet reference using cell A1 to change a vairable
    By Reed in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-20-2005, 04:06 PM

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