Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2022, 10:43 PM
thiennguyen93 thiennguyen93 is offline Select rows Windows 10 Select rows Office 2010
Novice
Select rows
 
Join Date: Jul 2022
Posts: 6
thiennguyen93 is on a distinguished road
Default Select rows


How do I selected the highlighted rows with 1 operation. Alt+Shift+end only allow me to select 1 one at a time.

I try to code in VBA, but I dont know how to start.

Thanks
Attached Images
File Type: png Capture.PNG (31.5 KB, 19 views)
Reply With Quote
  #2  
Old 07-27-2022, 07:11 AM
macropod's Avatar
macropod macropod is offline Select rows Windows 10 Select rows Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at:
Select multi row in Word table - Stack Overflow
Select multiple rows in Word table - MS Answers
For cross-posting etiquette, please read: A message to forum cross posters - Excelguru

Note: This is the second time in less than 24 hours that I've pinged you for cross-posting without applying the expected etiquette. Do it again and I'll terminate your account here.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-27-2022, 08:25 AM
thiennguyen93 thiennguyen93 is offline Select rows Windows 10 Select rows Office 2010
Novice
Select rows
 
Join Date: Jul 2022
Posts: 6
thiennguyen93 is on a distinguished road
Default

Hi,
I am sorry for the convenient. Would it be possible that you can help me with this question. I cant find the answer for this
Reply With Quote
  #4  
Old 07-27-2022, 03:50 PM
macropod's Avatar
macropod macropod is offline Select rows Windows 10 Select rows Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

As I already told you at StackOverflow, VBA cannot select discontiguous ranges. Manually, all you need do is select the first row, then hold down the Ctrl key whilst selecting the second row.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-27-2022, 04:05 PM
thiennguyen93 thiennguyen93 is offline Select rows Windows 10 Select rows Office 2010
Novice
Select rows
 
Join Date: Jul 2022
Posts: 6
thiennguyen93 is on a distinguished road
Default

Can I have your advice on this. I am working on VBA to look for a multiple text in table and highlight the corresponding rows. I am struggling with it. Can I have your advice?
Reply With Quote
  #6  
Old 07-27-2022, 04:10 PM
thiennguyen93 thiennguyen93 is offline Select rows Windows 10 Select rows Office 2010
Novice
Select rows
 
Join Date: Jul 2022
Posts: 6
thiennguyen93 is on a distinguished road
Default

this is the code I have so far.This code helps me find the list of input "AAAA", "BBBB", "CCCC", "DDDD" and highlight the rows have that value. However; it only highlights the row has 1st input "AAAA", but not "BBBB", "CCCC", and "DDDD" row.

Sub FindMultiItemsInDoc()

Dim objListDoc As Document

Dim objTargetDoc As Document

Dim objParaRange As Range, objFoundRange As Range

Dim objParagraph As Paragraph

Dim strFileName, arrM As String

Dim arr() As String



strFileName = InputBox("Enter the full name of the list document here:")

arr = Split(strFileName, ",")



For i = LBound(arr) To UBound(arr)

arrM = arr(i)



Application.ScreenUpdating = False

With ActiveDocument.Range

With .Find

.ClearFormatting

.Replacement.ClearFormatting

.Text = arrM

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindStop

.Format = False

.MatchWildcards = True

.Execute

End With

Do While .Find.Found

If .Information(wdWithInTable) = True Then

.Rows(1).Range.HighlightColorIndex = wdYellow



End If

.Collapse wdCollapseEnd

.Find.Execute

Loop

End With

Application.ScreenUpdating = True

Next i





End Sub
Reply With Quote
  #7  
Old 07-28-2022, 02:36 PM
macropod's Avatar
macropod macropod is offline Select rows Windows 10 Select rows Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Kindly read my reply about code formatting in: https://www.msofficeforums.com/word-...new-table.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, to Select all Rows with color Orange...... Cendrinne Word VBA 0 02-08-2022 02:59 AM
5000 rows, want to select and perform addition on ever 48 rows Rexmaverick Excel 5 06-10-2019 06:29 AM
Need to apply Heading1 to select rows bobk544 Word VBA 3 06-09-2018 05:24 AM
Select rows Select rows w/cells containing given character strings, then sum cell in two other col. LarryHills Excel 1 02-17-2017 03:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:50 AM.


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