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

Carterland

New Member
Joined
Jan 19, 2021
Messages
7
Office Version
  1. 2016
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
 

Carterland

New Member
Joined
Jan 19, 2021
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
Well it need some modification
But I have to go right now
Tomorrow I'll have a look at it
Sorry
Hi,

That's absolutely fine, just if/when you get chance, no pressure.

Thanks again :)
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

mohadin

Well-known Member
Joined
Mar 22, 2015
Messages
1,091
Office Version
  1. 2013
Platform
  1. Windows
Morning
Try this in Feedback Template
Let me know if this what you want
Thank you
 

Carterland

New Member
Joined
Jan 19, 2021
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
Morning
Try this in Feedback Template
Let me know if this what you want
Thank you
Hi,

Not sure if it just hasn't come through or there's an issue with my site but I can't see to see any code.

:)
 

mohadin

Well-known Member
Joined
Mar 22, 2015
Messages
1,091
Office Version
  1. 2013
Platform
  1. Windows
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
 

Carterland

New Member
Joined
Jan 19, 2021
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
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 :)
 

Watch MrExcel Video

Forum statistics

Threads
1,127,843
Messages
5,627,213
Members
416,230
Latest member
jdaitchman

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
Top