Macro to add prefill standard text headings

Apple08

Active Member
Joined
Nov 1, 2014
Messages
450
Hi All

I need to use Macro to add in prefill standard text headings for users to fill in their comments under the headings. I have the macro below. However it disables users filling in text under the headings. Please could anyone help?

VBA Code:
Private Sub Comments_Text()
  
    Dim x As Long, lastRow As Long

    lastRow = Cells(Rows.Count, "A").End(xlUp).row
    
    Range("G2:G" & lastRow).Value = "1. Status" & Chr(10) & "2. Current Issues" & Chr(10) & "3. Risks"

End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi,

not quite sure what you mean by "under the headings" - do you mean you cannot enter any data in Col G starting Row 3 ? (as I don't share the issue)?

In order to enter data into the same cell as the headings (your macro gives the output below on a blank worksheet), you need to use "Alt+Enter" when the cursor is on 1. Status etc. ?

Does it help ?
cheers
Rob

SEQUENCE_example.xlsx
ABCDEFGH
11. Status 2. Current Issues 3. Risks
21. Status 2. Current Issues 3. Risks
3
Sheet1
 
Upvote 0
Solution
Great, glad to be of help...

thanks for the feedback
Rob
 
Upvote 0

Forum statistics

Threads
1,214,897
Messages
6,122,141
Members
449,066
Latest member
Andyg666

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