+ Reply to Thread
Results 1 to 6 of 6

Thread: macro for copy a cell

  1. #1
    Registered User
    Join Date
    06-06-2011
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    8

    Smile macro for copy a cell

    how can i make a macro do the following:
    copy the active cell and past in the second cell ( never mind the name of the cell )

  2. #2
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: macro for copy a cell

    Hi,

    By second cell do you mean the one next to it?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Valued Forum Contributor
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    412

    Re: macro for copy a cell

    simple
    activecell.copy activecell.offset(,1) 'for copy to next column
    activecell.copy activecell.offset(1,0) 'for copy under activecell

  4. #4
    Registered User
    Join Date
    06-09-2011
    Location
    Leeds, UK
    MS-Off Ver
    MS Office 2007
    Posts
    41

    Re: macro for copy a cell

    try this

    
        ActiveCell.Select
        Selection.Copy
        ActiveCell.Offset(0, 1).Select
        ActiveSheet.Paste
        Application.CutCopyMode = False
    Change the parameter of "Offset" function to select desire cell

  5. #5
    Registered User
    Join Date
    06-06-2011
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: macro for copy a cell

    thank you all

    but

    how can i make this macro run each time i open this workbook

  6. #6
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: macro for copy a cell

    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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.2.0