|
-
Oct 21st, 2009, 09:33 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Merged Cells
hi guys, is there a way to check in vba to count how many rows has been merged in a particular column?
let's say in column A i merged rows 1 to 10, by clicking that particular merged cells rows 1 to 10 on the left will be highlighted so user will know that 10 rows has been merged..but to do this in a macro is there a way to count those rows that has been merged? any ideas is greatly appreciated..
The taller the bamboo grows the lower it bends... 
-
Oct 22nd, 2009, 02:14 AM
#2
Re: Merged Cells
vb Code:
Private Sub MergedCellsRowsCount() Dim strAddress As String, MyArray() As String strAddress = Selection.Address '~~> Check if cells are merged If Selection.MergeCells Then If InStr(1, strAddress, ":") > 0 Then MyArray = Split(strAddress, ":") '~~> Display the number of rows in the Range MsgBox "The Selected range has " & _ Range(MyArray(1)).Row - Range(MyArray(0)).Row & " merged Rows" Else MsgBox "Please select a Merged Cell" End If Else MsgBox "Please select a Merged Cell" End If End Sub
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 22nd, 2009, 06:30 AM
#3
Thread Starter
Addicted Member
Re: Merged Cells
thanks.Koolsid
The taller the bamboo grows the lower it bends... 
-
Oct 22nd, 2009, 06:57 AM
#4
Re: [RESOLVED] Merged Cells
Glad to be of help
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|