Results 1 to 3 of 3

Macro that does the same for every cell

Threaded View

WadeWilson Macro that does the same for... 02-13-2013, 09:07 AM
RHCPgergo Re: Macro that does the same... 02-13-2013, 09:20 AM
Jakobshavn Re: Macro that does the same... 02-13-2013, 09:25 AM
  1. #1
    Registered User
    Join Date
    02-13-2013
    Location
    Slovenia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Macro that does the same for every cell

    I didn't knew what title to give this thread. I have a sheet, where in A1 i have John Doe, under A2 i have Patrick Swayze... etc etc you get the picture. Now i want to make a macro button which does the following: A1 John and B1 Doe, A2 Patrick and B2 Swayze. Do you understand me? Now i never worked with macros before and i never even touched visual basic. But i've made the following. It works, but it always puts the same names
    This is the code
    Sub Makro1()
    '
    ' Makro1 Makro
    '
    
    '
        ActiveCell.Select
        ActiveCell.FormulaR1C1 = "John "
        ActiveCell.Offset(0, 1).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(1, -1).Range("A1").Select
    End Sub
    now if i select A1 where John Doe is and run the macro, it puts John in A1 and Doe in B1, which is good. But if i select patrick swayze which is in A2 and run the macro, it puts John in A2 and Doe in B2 but it should be Patrick in A2 and Swayze in B2
    Last edited by WadeWilson; 02-13-2013 at 09:11 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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