+ Reply to Thread
Results 1 to 8 of 8

Changing the cell values by macro to a cell in another column

  1. #1
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Changing the cell values by macro to a cell in another column

    I need a macro that sets the value of selected cell to the cell in column "B" which has the same row number with selected cell.
    Example :

    When I run the macro when the cell A3 is selected it should make the A3 equal to B3. (selected cell still should be A3)
    Or when T39 is selected macro should make the value of the cell as B39. (And after the process the selected cell should be still T39.

    Thanks in advance.
    Last edited by erguntmzkn; 05-14-2013 at 05:55 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: A Simple Macro

    Hi,

    Try this
    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: A Simple Macro

    Hi erguntmzkn,

    You can use below macro:-

    Please Login or Register  to view this content.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A Simple Macro

    Thank you. And can you give me the one that provides the value "-" ?
    I mean A3 will turn to -B3. If B3 is equal to 14. When I run the macro A3 will be -14.
    Thanks again.

  5. #5
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A Simple Macro

    And actually I want to select the next row after macro. I mean when I run it the value in cell A3 will be B3 and the selected cell will be B4. Is it possible ? Thanks.

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: A Simple Macro

    I mean when I run it the value in cell A3 will be B3 and the selected cell will be B4.
    Not getting you... you are standing on B4 and macro will fetch value of A4 .. that's what your requirement was... correct?
    Now, do yo want to fill all rows above to your selected cell to be filled up with column A's value ?


    Regards,
    DILIPandey
    <click on below * if this helps>

  7. #7
    Registered User
    Join Date
    03-04-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: A Simple Macro

    No I just want the same macro that you gave me and only want the selected cell will be the next row. I mean after running macro selected cell will be A4.

    Like this.

    Selected cell ---> A3
    Run macro ---> A3 will be equal to B3
    Selected cell will be ---> A4

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: A Simple Macro

    erguntmzkn,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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