Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Premium Land with House for Sale
anil1961
Updated:
Today at 10:15 AM
AWS Certified Solutions Architect-Associate + AWS Certified Cloud Practitioner
Sanjeewani95
Updated:
Wednesday at 8:16 PM
🚀 එක පැකේජ් එකයි - මාසෙටම Unlimited Internet! 🌐
sayuru bandara
Updated:
Tuesday at 10:57 AM
🎬 CapCut Pro 1 Month Access! LKR 600
sayuru bandara
Updated:
Tuesday at 10:55 AM
🚀 Google One AI PRO Plan (Gemini Pro Activation) – 18 Months Access! LKR 2200
sayuru bandara
Updated:
Tuesday at 10:53 AM
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
Excel උදව්වක් ඕන (VBA හරි කමක්නෑ)
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="TakaTakas" data-source="post: 24657517" data-attributes="member: 518023"><p><span style="font-size: 15px">මචං මට මේ කෝඩ් එකේ කොලම් 1 සහ 2 වෙනස් කරල </span></p><p><span style="font-size: 15px">මට ඕන රෝ එකක් දාගන්න යි. මුළු කොලම් එකම සෙලකේට් වෙන්නෙ නැතිව</span></p><p><span style="font-size: 15px">මට අවශ්ය සෙල් රේන්ජ් එකයි දාගන්න විදිය කියපන්කො තරහ නැතිව.</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">Private Sub CommandButton1_Click()</span></p><p><span style="font-size: 15px">Dim RangeToFormat As Range</span></p><p><span style="font-size: 15px">Dim RangeToFormat1 As Range</span></p><p><span style="font-size: 15px">Set RangeToFormat = ThisWorkbook.ActiveSheet.Columns(1)</span></p><p><span style="font-size: 15px">Set RangeToFormat1 = ThisWorkbook.ActiveSheet.Columns(2)</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">Call ApplyCondition(RangeToFormat, "=B1")</span></p><p><span style="font-size: 15px">Call ApplyCondition(RangeToFormat1, "=A1")</span></p><p><span style="font-size: 15px">End Sub</span></p><p><span style="font-size: 15px">Private Sub ApplyCondition(RangeToFormat As Range, Condition As String)</span></p><p><span style="font-size: 15px">RangeToFormat.FormatConditions.Delete</span></p><p><span style="font-size: 15px"> </span></p><p><span style="font-size: 15px"> RangeToFormat.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _</span></p><p><span style="font-size: 15px"> Formula1:=Condition</span></p><p><span style="font-size: 15px"> RangeToFormat.FormatConditions(RangeToFormat.FormatConditions.Count).SetFirstPriority</span></p><p><span style="font-size: 15px"> With RangeToFormat.FormatConditions(1).Interior</span></p><p><span style="font-size: 15px"> .PatternColorIndex = xlAutomatic</span></p><p><span style="font-size: 15px"> .Color = 255</span></p><p><span style="font-size: 15px"> .TintAndShade = 0</span></p><p><span style="font-size: 15px"> End With</span></p><p><span style="font-size: 15px"> RangeToFormat.FormatConditions(1).StopIfTrue = False</span></p><p><span style="font-size: 15px">End Sub</span></p><p></p><p><img src="https://i.imgur.com/8XgWJeV.jpg?1" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p></blockquote><p></p>
[QUOTE="TakaTakas, post: 24657517, member: 518023"] [SIZE="4"]මචං මට මේ කෝඩ් එකේ කොලම් 1 සහ 2 වෙනස් කරල මට ඕන රෝ එකක් දාගන්න යි. මුළු කොලම් එකම සෙලකේට් වෙන්නෙ නැතිව මට අවශ්ය සෙල් රේන්ජ් එකයි දාගන්න විදිය කියපන්කො තරහ නැතිව. Private Sub CommandButton1_Click() Dim RangeToFormat As Range Dim RangeToFormat1 As Range Set RangeToFormat = ThisWorkbook.ActiveSheet.Columns(1) Set RangeToFormat1 = ThisWorkbook.ActiveSheet.Columns(2) Call ApplyCondition(RangeToFormat, "=B1") Call ApplyCondition(RangeToFormat1, "=A1") End Sub Private Sub ApplyCondition(RangeToFormat As Range, Condition As String) RangeToFormat.FormatConditions.Delete RangeToFormat.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:=Condition RangeToFormat.FormatConditions(RangeToFormat.FormatConditions.Count).SetFirstPriority With RangeToFormat.FormatConditions(1).Interior .PatternColorIndex = xlAutomatic .Color = 255 .TintAndShade = 0 End With RangeToFormat.FormatConditions(1).StopIfTrue = False End Sub[/SIZE] [img]https://i.imgur.com/8XgWJeV.jpg?1[/img] [/QUOTE]
Insert quotes…
Verification
Payakata winadi keeyak tibeda?
Post reply
Top
Bottom