Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-23-2018, 09:35 AM
vjvj123 vjvj123 is offline Wish to delete letters to the right of the cursor in a Table cell, but whole cell is being deleted Windows 10 Wish to delete letters to the right of the cursor in a Table cell, but whole cell is being deleted Office 2016
Novice
Wish to delete letters to the right of the cursor in a Table cell, but whole cell is being deleted
 
Join Date: Sep 2018
Posts: 11
vjvj123 is on a distinguished road
Default Wish to delete letters to the right of the cursor in a Table cell, but whole cell is being deleted

Hi All,

I have a large table, with some cells having a character "#" in between some of the texts. For eg, there is a special character "#" in the text FESM#RAMAN. I wish to find the # character and then delete ALL the letters to the right of it in that particular cell, i.e. I wish to be left with FESEM only in the cell. I have recorded a macro for this, which goes to the home (Ctrl+Home), finds #, then the macro performs "del" operation repeatedly (i.e. the first instance of "del" deletes the # since it is selected, and then the subsequent instances of "del" delete the following letters R,A,M etc.
My problem is that I do not know before-hand exactly how many characters are there following #, although I can safely assume it to be 20 characters max, so in the macro the "del" operation is repeated about 20 times. However, I observe that (say for the above case FESM#RAMAN, after deleting # and the letters R,A,M,A,N, it deletes the whole content of the cell, leaving a blank cell behind. This problem is not apparent when I record the macro or when I replicate the process manually (as the cursor reaches in the end and the subsequent "del" have no effect), but when this recorded macro is run, the next press of del deletes the contents to the left also (within the cell). This is came to know by stepping into macro and using F8.




Please suggest (preferably using record-macro operation as I am not conversant with VBA) how to delete only the desired letters, leaving, for eg, FESM intact.
[Version: Office 365, Windows 10]
Reply With Quote
 

Tags
delete text toright, macro, table cell



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wish to delete letters to the right of the cursor in a Table cell, but whole cell is being deleted cell alignment gets deleted when using backspace in a cell saandahn Word Tables 4 01-08-2018 09:27 AM
How to delete unused cell remaining at end of a block of deleted data SKEETER Excel 2 10-24-2017 07:06 AM
How can I delete spaces & lines in a table cell mrayncrental Word VBA 3 10-20-2014 07:09 PM
Wish to delete letters to the right of the cursor in a Table cell, but whole cell is being deleted Delete table if cell has data So New2 This Word VBA 1 05-06-2013 09:00 PM
How can I delete the content of a cell in column if the cell value is more than 1000? Learner7 Excel 2 06-27-2011 05:44 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft