簡體   English   中英

如何在Excel中比較和突出顯示一列中的字符串列表

[英]How to compare and highlight list of strings in one column with another column in excel

我有兩列A和B,Coulmn A具有所有句子,B列具有動詞,這些動詞正在A列的句子中使用。

我想在匹配項中查找A列中B列的每個動詞,我希望該動詞在A列中突出顯示。

就像在Coulmn A的所有句子中一個一個地尋找動詞一樣。

A欄

Summarize visualize and interpret data using tabular and graphical methods
Apply simple discrete probability models to analyze data related to quality such as particle size and ore concentration and to evaluate risk factors such as safety and environmental compliance
Formulate confidence intervals and hypothesis tests for the sample average and sample variance under standard conditions
Apply continuous probability models to assist in decision making with applications to quality improvement resource estimation safety and environmental compliance
Apply computer intensive methods to extend applications of statistical methods to nonstandard situations
Develop and analyze linear models to describe and predict process and laboratory behavior
Explain the phase rule and the fundamental concepts used in a phase diagram including critical state supercritical fluid phase transition and triple point
Describe the concept of a generalized equation of state and the laws of corresponding states to represent nonideal fluid behaviour
Acquire a deeper understanding of the Second Law of Thermodynamics that includes Carnots Theorem and the concept of entropy and its implications to process efficiency of unit operations such as pumps compressors turboexpanders and throttles
Calculate values of heat work enthalpy entropy and other thermodynamic properties and quantities Apply the concept of residual properties to calculate the efficiency of processes
Apply the fundamental concepts of thermodynamics to solving material energy and entropy balances for process components
Apply the combined material energy and entropy balance equations to solve process flow diagrams for basic power plants and refrigeration
Describe and analyze the performance the Rankine cycle the Brayton Cycles and other simple cycles Understand the concept of coefficient of performance
Demonstrate proficiency in operation and control of process and analytical equipment
Demonstrate engineering judgment and an awareness of the nature and magnitude of physical and chemical effects and factors as well as errors and uncertainties
Collect and interpret data to draw meaningful conclusions and evaluate the strengths weaknesses and limitations of current chemical engineering theory
Write concise coherent and grammatically correct lab reports that reflect critical analysis and synthesis Deliver clear and organized formal oral presentations
Demonstrate effective independent learning initiative originality and creativity in completion of prelab preparation and other tasks
Work effectively as group member and demonstrate good leadership skills when team leader adopting a professional approach during all project phases
Document and follow appropriate safety protocols
Draw and fully label a process flow diagram PFD for application of material and energy balances
Formulate and solve the material balance equations to analyze steadystate singleunit and multipleunit processes without reaction
Formulate and solve the material balance equations to analyze steadystate processes with reaction
Formulate and solve combined steadystate material and energy balances for chemical processes
Develop dynamic and steadystate models of chemical processes using mass balance energy balance and constitutive relationships
Calculate states inputs or parameters at steady states via solving relevant algebraic equations
Analyze process dynamics via solving relevant ordinary differential equations
Develop linearized models with deviation variables and assess the stability of process steady states via both eigenvalue analysis and Laplace transform of the linearized models
Solve complex algebraic and ordinary differential equations using MATLAB builtin functions and implement classical numerical methods on MATLAB
Calculate the pressure distribution in static fluids and the forces on submerged surfaces
Formulate mass momentum and energy balances using the control volume and differential analysis of fluid flow
Identify boundary conditions and solve differential equations describing onedimensional fluid flow
Determine frictional losses size pipes and calculate pump power requirements in laminar and turbulent flow for viscous flow in closed conduits
Calculate the drag forces on submerged objects in laminar and turbulent flow
Use dimensional analysis to derive relationships among process or system variables
Apply knowledge developed in steps   and  above to measure pressure and flow rates to estimate forces acting on pipes and joints and to size pumps and pipes Develop an understanding of the cost implications on developing a pumping process
Calculate centre of mass moment of inertia and volumes using multiple integrals to determine hydrostatic forces on surfaces
Analyze transport phenomena fundamentals forces in space moment of a force work done by a force and fluid kinematics displacement velocity and acceleration motion along a curve Define streamlines streaklines and pathlines Tools used include vectors in space dot product cross product areas and determinants in D volumes and determinants in D parametric representation of curves intersection of a line and a plane
Apply the integral relations for a control volume and the Reynolds transport theorem to analyze fluid motion
Analyze fluid motion using the differential analysis Velocity and acceleration fields linear and angular motion and deformation differential form of the continuity equation Cartesian and polar forms stream function potential function Associated mathematical framework vector fields divergence and curl
Formulate equations for heat and momentum transport using partial derivatives multivariable functions differentials the chain rule for multivariable functions directional derivatives
Development of mathematical skills i the mathematical formulation of engineering transport problems and corresponding analytical solution strategies ii Handling of differential operators in vector calculus and coordinate systems important for engineering applications
Identify and explain the major cellular processes in prokaryotes and eukaryotes
Describe the interrelationships between organisms and their environments
Identify and describe the relationship between structure and function on a molecular cellular and organismal level
Identify a range of fields where biological systems are being applied to solve engineering problems and discuss the most recent advances in each field as well as the strengths and limitations of each approach
Demonstrate laboratory skills and expertise with microbiological techniques
Recognize customer segments and develop value propositions and assess and develop markets for productsservices
Manage the development of a product and venture
Assess the viability of a project or venture using appropriate financial metrics eg NPV IRR EBITDA
Investigate problems and determine solutions using systems and design thinking approaches in both industrial and societal contexts
Explain a variety of advanced molecular and cellular biology techniques used for the characterization and manipulation of microorganisms with applications in medicine industry and the environment
Understand the  elements of a business model value propositions customer segments channels key resources key activities key partners cost structure revenue streams customer relationships identify these elements in existing ventures and differentiate between different contexts entrepreneurial versus intrapreneurial forprofit and notforprofit
Investigate existing intellectual property IP using appropriate tools summarize the competitive technology landscape and determine the appropriate manner for protecting intellectual property
Recognize societal needs in regards to products and services and develop a social license to operate
Identify and understand the principles of chemical equilibrium thermodynamics to solve multiphase equilibria and chemical reaction equilibria
Analyze the conditions associated with ideal and nonideal vapourliquid systems at equilibrium through the construction and interpretation of phase diagrams for ideal and nonideal binary mixtures
Use empirical correlations and experimental data to evaluate thermodynamic quantities that relate to the vapourliquid or liquidliquid equilibria of ideal and nonideal chemical mixtures
Determine equilibrium constants for chemical reactions and equilibrium point compositions for multiple reaction systems
Solve single and multistage separation processes involving nonideal chemical mixtures using numerical methods and simulations and recommend appropriate operating conditions
Demonstrate proficiency in operation and control of process and analytical equipment
Demonstrate engineering judgment and an awareness of the nature and magnitude of physical and chemical effects and factors as well as errors and uncertainties
Collect and interpret data to draw meaningful conclusions and evaluate the strengths weaknesses and limitations of current chemical engineering theory
Write concise coherent and grammatically correct lab reports that reflect critical analysis and synthesis Deliver clear and organized formal oral presentation
Demonstrate effective independent learning initiative originality and creativity in completion of prelab preparation and other tasks

B欄

accept
access
acquire
act
adapt
adhere
analyze
apply
appraise
argue
arrange
ask
assemble
assess
assist
calculate
calibrate
carry out
categorize
choose
classify
co-ordinate
collaborate
collect
combine
commission
communicate
compare
complete
comply
compose
conduct
configure
conform
connect
consolidate
construct
contact
contrast
contribute
create
criticize
critique
debate
debug
decide
deduce
defend
define
deliver
demonstrate
describe
design
determine
develop
differentiate
discriminate
discuss
distinguish
do
document
dramatize
draw
eliminate
employ
engage
ensure
establish
estimate
evaluate
examine
execute
exercise
explain
experiment
express
extend
fabricate
find
follow
formulate
generalize
handle
hypothesize
identify
illustrate
implement
indicate
infer
inspect
install
integrate
interact
interpret
interrelate
invent
investigate
judge
keep
label
list
locate
maintain
make
make up
manage
manipulate
manufacture
match
memorize
modify
monitor
name
operate
omit
order
organize
originate
paint
paraphrase
participate
perform
plan
point out
practice
predict
prepare
prepare
prioritize
produce
program
promote
propose
quantify
question
rate
recall
recite
recognize
recommend
relate
repair
replace
report
represent
reproduce
research
respond
restate
review
rewrite
select
separate
service
set up
share
show
simulate
sketch
solve
source
specify
state
subdivide
summarize
support
survey
synthesize
take
tell
test
translate
troubleshoot
tune
understand
upgrade
use
utilize
validate
value
verify
weigh
work
write
Sub FindAndHighlight()
Const HighLightColor = vbRed 'choose colour here
Dim ws As Worksheet
Set ws = Worksheets("your sheet name here")
Dim Sentences As Range
Dim Verbs As Range
Set Sentences = Intersect(ws.UsedRange, ws.Columns("A"))
Set Verbs = Intersect(ws.UsedRange, ws.Columns("B"))
Dim s As Range
Dim v As Range
Dim x As Integer

For Each s In Sentences
    For Each v In Verbs
        x = InStr(s.Text, v.Text)
        If x > 0 Then
             s.Characters(x, Len(v.Text)).Font.Color = HighLightColor
        End If
    Next v
Next s
End Sub

我在這里沒有Excel(我在電話上),因此可能存在語法錯誤,但這應該可以幫助您入門

或者您可以使用正則表達式:

Sub test()

Dim cellA As Range
Dim cellB As Range

For Each cellA In ActiveSheet.Columns("A").Cells
    If cellA <> vbNullString Then
        For Each cellB In ActiveSheet.Columns("B").Cells
            If cellB <> vbNullString Then
                Call RegEx_Extract(cellB.Value, cellA)
            End If
        Next cellB
    End If
Next cellA

End Sub

Sub RegEx_Extract(sPattern As String, rSearch As Range)

Set regEx = CreateObject("Vbscript.Regexp")
strToSearch = rSearch.Value
With regEx
.Global = True
.IgnoreCase = True
.Pattern = "\b" & sPattern & "\b"
'if you want to find mach inside other words just remove \b
Set regEx_Matches = .Execute(strToSearch)
End With

For Each itm In regEx_Matches

rSearch.Characters(itm.FirstIndex, Len(sPattern) + 1).Font.Color = vbRed

Next itm


End Sub

這應該完成工作:

Option Explicit

Sub Main()
    Dim word As Variant
    Dim verbs As Variant, verb As Variant
    Dim f As Range
    Dim firstAddress As String
    Dim pos As Long

    With Worksheets("mySheetName") ' reference your sheet "change "mySheetName" to your actual sheet name)
        verbs = Application.Transpose(.Range("B1", .Cells(.Rows.Count, 2).End(xlUp)).Value) ' store all verbs in an array
        With .Range("A1", .Cells(.Rows.Count, 1).End(xlUp)) ' reference referenced sheet column A cells from row 1 down to last not empty one
            For Each verb In verbs ' loop through each verb
                Set f = .Find(what:=verb, LookIn:=xlValues, lookat:=xlPart) ' try finding current verb occurrence in referenced range
                If Not f Is Nothing Then ' if found
                    firstAddress = f.Address ' store found cell address
                    Do
                        pos = 1 ' initialize "first" character index where to start formatting from
                        For Each word In Split(f.Text, " ") ' loop through current found cell text words
                            If UCase(word) = UCase(verb) Then f.Characters(pos, Len(verb)).Font.Color = vbRed ' if current word matches current verb, color word
                            pos = pos + Len(word) + 1 ' update "first" character index with the already processed word
                        Next
                        Set f = .FindNext(f) 'try finding current verb next occurrence in referenced range
                    Loop While f.Address <> firstAddress ' loop until you wrap back to the first found occurrence of the current verb in the referenced range
                End If
            Next
        End With
    End With
End Sub

您應該注意:

  • 使用Find()方法將通過A列語句的循環數限制為實際上可能包含當前動詞的循環數(請參閱后續說明)

  • 經處理的句子的划分到一個數組( For Each word In Split(f.Text, " ")來捕捉當前的動詞避免嵌入出現(例如發生:’ 行為 ”中“F 動作 ORS”),並考慮邊緣出現(如果搜索“ summary”,則不會在“ Summarize visualize and ...”中得到它)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM