VBA to copy line from one sheet into specific cells on another sheet?

Carterland

New Member
Joined
Jan 19, 2021
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hi all,

New to the site so thanks for having me, I'm also new to VBA so be gentle lol

Basically I'm trying to speed up a process for something at work which involves trying to creat a macro button that would allow me to highlight a row, press a button and the data from specific cells in that row copied and pasted (values only) into another worksheet in specific cells as I've set up a template.

Firstly, is it possibly? And secondly how lol

The data would need to be as follows

From selected row on sheet names 'Log' copy cells to sheet named 'Feedback Template'

G - C6
L - C8
M - C10
K - C12
Q - C14
R - C17

Where I've specified the column on the above for the copy part, that would need to look in the highlighted tow for the correct number of the line.

If anyone could help I'd be so grateful.

Thanks in advance

Shaun
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Morning
Try this in Feedback Template
Let me know if this what you want
Thank you
 
Upvote 0
OPs
Sorry
Here you are
VBA Code:
Sub test()
    Application.ScreenUpdating = False
    Sheets("Log").Select
    With Worksheets("Feedback Template")
        .Range("C6") = Worksheets("Log").Range("G" & Selection.Row)
        .Range("C8") = Worksheets("Log").Range("L" & Selection.Row)
        .Range("C10") = Worksheets("Log").Range("M" & Selection.Row)
        .Range("C12") = Worksheets("Log").Range("K" & Selection.Row)
        .Range("C14") = Worksheets("Log").Range("Q" & Selection.Row)
        .Range("C17") = Worksheets("Log").Range("R" & Selection.Row)
    End With
    Sheets("Feedback Template").select
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
OPs
Sorry
Here you are
VBA Code:
Sub test()
    Application.ScreenUpdating = False
    Sheets("Log").Select
    With Worksheets("Feedback Template")
        .Range("C6") = Worksheets("Log").Range("G" & Selection.Row)
        .Range("C8") = Worksheets("Log").Range("L" & Selection.Row)
        .Range("C10") = Worksheets("Log").Range("M" & Selection.Row)
        .Range("C12") = Worksheets("Log").Range("K" & Selection.Row)
        .Range("C14") = Worksheets("Log").Range("Q" & Selection.Row)
        .Range("C17") = Worksheets("Log").Range("R" & Selection.Row)
    End With
    Sheets("Feedback Template").select
    Application.ScreenUpdating = True
End Sub
Absolute superstar. Thanks :)
 
Upvote 0

Forum statistics

Threads
1,214,804
Messages
6,121,652
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top