macro to insert a character into cell

RobbieC

Active Member
Joined
Dec 14, 2016
Messages
376
Office Version
  1. 2010
Platform
  1. Windows
Hi there, I have a workbook where, when any cell is selected, it goes into "edit mode" - ie the cursor flashes at the end of the cell content

I have a button in a "mini menu" where I want a 'fake' bullet point 'ChrW(&H25CF)' to be inserted where the cursor is flashing.

I know that this is probably really simple, but I have been struck down with the lurg and my brain isn't operating properly

If you can point me in the right direction, I'd be really grateful

Thanks

Rob
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hello,

The automatic Edit Mode will prevent you from inserted your bullet point ...

Why don't you give a specific example of your ' before - after ' cell ...
 
Upvote 0
Thanks James, I have just come up with a solution:

Code:
Sub insertBullet()
If ActiveCell.Value = "" Then
    ActiveCell.Value = Space(3) & ChrW(&H25CF) & Space(3)
    Application.SendKeys "{F2}"
Else
    ActiveCell.Value = ActiveCell.Value & vbCrLf & Space(3) & ChrW(&H25CF) & Space(3)
    Application.SendKeys "{F2}"
End If
End Sub
I have a 'shape' on each sheet with insertBullet assigned as the macro.

If the cell is blank, it will add 3 spaces, insert the bullet point, insert another 3 spaces and then activate the cell to edit at this point.

If the cell is not blank, it will copy the cell contents, add a line break, add 3 spaces, add the bullet, another 3 spaces and then activate the cell to edit at this point.

Seems to work for me :)
 
Upvote 0

Forum statistics

Threads
1,212,929
Messages
6,110,740
Members
448,295
Latest member
Uzair Tahir Khan

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