macros to paste to certain cells

  • Ok here goes I'll see if I can explain what I want to do. Keep in mind although I use excel regulary I have not used macros before.
    In the one workbook I have a master sheet and then info sheets, what I want to do is have a keyboard shortcut that copies certain cells from the master sheet and have them pasted into the cell that I have highlighted in the info sheet. I have tried recording a macro but it always pastes the cells to the exact same spot, how can I get it to paste them where i am in the info sheet not just where i was when i recorded the macro?
    Did that make sense? I will attach the file which may make more sense.

  • Re: macros to paste to certain cells


    Hi neff


    Did you try recording the macro with a the "relative reference" button pushed in?


    To have someone write a macro, specific details of your needs will be needed.

  • Re: macros to paste to certain cells


    yes tried that but didn't seem to help, what specific details would i need to tell you.
    sorry that i am so incompetent but im new at this.

  • Re: macros to paste to certain cells


    ok I've playing again and i have managed to get it to do what i want but only for one sheet.
    Here is the macro:
    [vba]
    Sub Macro14()
    '
    ' Macro14 Macro
    ' Macro recorded 17.02.2005 by admin
    '
    ' Keyboard Shortcut: Ctrl+z
    '
    Sheets("Sheet1").Select
    Range("A1:C2").Select
    Selection.Copy
    Sheets("Sheet2").Select
    ActiveSheet.Paste
    End Sub
    [/vba]
    The problem is i want to be able to paste to any sheet not just sheet 2
    Is this possible?

  • Re: macros to paste to certain cells


    Um, i feel really dumb, i read the rules and the click here help for codes but i'm still not sure exactly what ive done wrong. sorry to be a pain, i just copied the macro and pasted it in my message, i only got the 'code' by recording a macro so i have no idea what it actually means. if you could tell me where i went wrong i will try and fix it. thanx for replying so quickly, even if i'm just a new, ignorant user. :)

  • Re: macros to paste to certain cells


    Hi Neff,


    Please follow these to add Code tags:


    Start with ["vba"] and end with [/"vba"]. Type vba without the quotes.
    Type code in between these two. Then your code looks like this.


    [vba]
    Sub Macro14()
    '
    ' Macro14 Macro
    ' Macro recorded 17.02.2005 by admin
    '
    ' Keyboard Shortcut: Ctrl+z
    '
    Sheets("Sheet1").Select
    Range("A1:C2").Select
    Selection.Copy
    Sheets("Sheet2").Select
    ActiveSheet.Paste
    End Sub
    [/vba]


    Regarding your query, try a search first in this forum. I am sure these sort of questions are already been answered. If you still have some difficulty post back, stating your problem clearly.


    HTH.

  • Re: macros to paste to certain cells


    I have tried a search but couldn't seem to find anything that would help. Let me see if I can explain more clearly.
    I need to be able to paste a range of cells from one sheet into numerous other sheets, numerous times. I would like to be able to just press a shortcut key and have the range of cells from my master sheet paste to wherever i am when i hit the shortcut key. I have managed to record a macro that allows me to do this for one sheet but i cannot get it to work for more than one sheet. I know this is probably a basic problem, but i have never used macros before and just can't seem to work it out. i would appreciate any help anyone can give me. here is the macro as i have it so far:
    [vba]
    Sub Macro14()
    '
    ' Macro14 Macro
    ' Macro recorded 17.02.2005 by admin
    '
    ' Keyboard Shortcut: Ctrl+z
    '
    Sheets("Sheet1").Select
    Range("A1:C2").Select
    Selection.Copy
    Sheets("Sheet2").Select
    ActiveSheet.Paste
    End Sub
    [/vba]

  • Re: macros to paste to certain cells


    Here is the file again, I need to copy cells A2 to E5 on the template sheet, and I need to be able to paste them to numerous cells in the numbered sheets. ie. each week i need to add more info to all the numbered sheets, plus i will need to create new numbered sheets that i will also need to add info to, so i just need to be able to quickly paste the cells from the template sheet to pretty much wherever i am in the document. does that make sense? :thanx:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!