Macro for pasting text in a cell

trevolly

Board Regular
Joined
Aug 22, 2021
Messages
120
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm wondering if anyone can advice on any vba code that could help me. I would like to be able to select a cell and then press a macro linked button which would then paste / enter text in to that cell. The text would be in the form of.....

Ops 1:
Ops 2:
LDR 3:
LDR 4:
LDR 5:
LDR 6:
LDR 7:
LDR 8:
LDR 9:
LDR 10:

Id appreciate any help.

Regards T
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You want all of those rows of text in a single cell? Create a button and associate with this macro:
VBA Code:
Public Sub LoadText()

   ActiveCell.Value = _
         "Ops 1:" & char(10) & _
         "Ops 2:" & char(10) & _
         "LDR 3:" & char(10) & _
         "LDR 4:" & char(10) & _
         "LDR 5:" & char(10) & _
         "LDR 6:" & char(10) & _
         "LDR 7:" & char(10) & _
         "LDR 8:" & char(10) & _
         "LDR 9:" & char(10) & _
         "LDR 10:"
         
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,960
Messages
6,122,479
Members
449,088
Latest member
Melvetica

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