Macro to select columns A to L from the selected A Column cells

caligirl626

New Member
Joined
Nov 28, 2022
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Hello everyone. Looking for a macro that will copy row information from column A through L.

1669695314111.png


This code below copies a single row, in this case Row 2, cells A2:K2, as shown above.

VBA Code:
Sub Macro1()
'
' Macro1 Macro
'

'
    ActiveCell.Range("A1:K1").Select
    Selection.Copy
End Sub

How can the code be modified to copy all the columns, A thru K, of user selected A column cells?
For the example shown below, if cells A4 to A7 are selected, the macro should copy array A4:K7

1669696077148.png


The macro should consider that the number of the user selected column A cells will vary. TIA
 

Attachments

  • 1669695234259.png
    1669695234259.png
    48.5 KB · Views: 7
Ok, this is now a significantly different question & so needs a new thread. Thanks
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,214,832
Messages
6,121,854
Members
449,051
Latest member
excelquestion515

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