![]() |
|
#5
|
|||
|
|||
|
ctviggen, what exactly do you want to delete in
[00344](tab)Text I added [00345](tab)[00345] Beginning of what was pasted in...? Everything until or after the tab? Or maybe sth else? If you want to delete everything until after the tab in the selected paragraphs, try this: Code:
Sub Del_Until()
Dim rng As range, oPar As Paragraph
Application.ScreenUpdating = False
Set rng = selection.range
For Each oPar In rng.Paragraphs
oPar.range.Select
selection.MoveEndUntil cset:=vbTab, count:=wdBackward
selection.Delete
Next oPar
Application.ScreenUpdating = True
Set rng = Nothing
End Sub
Code:
Sub Del_Until()
selection.Paragraphs(2).range.Select
selection.MoveEndUntil cset:=vbTab, count:=wdBackward
selection.Delete
Set rng = Nothing
End Sub
Last edited by vivka; 03-10-2024 at 11:10 AM. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleting all text from a slide pack without deleting the formatting | redordead2389 | PowerPoint | 0 | 05-31-2023 06:50 AM |
Word macro for deleting a line that starts with a specific character + deleting the line before
|
eduardb | Word | 1 | 08-10-2022 03:17 AM |
| Inserting text from a Userform into a Field in a paragraph in a paragraph in a word document | storemaz | Word VBA | 1 | 03-13-2020 08:11 AM |
Deleting paragraph commands
|
afndst | Word VBA | 2 | 12-30-2015 02:07 AM |
Deleting a script in an equation without deleting the whole term
|
allankey | Word | 1 | 02-15-2014 07:09 AM |