|
-
Apr 13th, 2010, 08:54 AM
#1
Thread Starter
Lively Member
counting the number of cells at intervals of a string in column C
Hi I would like to count the number of cells in my data.
The cell intervals are seperated by this string "SICOM" in column C.
Can someone help me?
Thank you very much.
-
Apr 13th, 2010, 09:33 AM
#2
Re: counting the number of cells at intervals of a string in column C
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
-
Apr 14th, 2010, 07:10 AM
#3
Re: counting the number of cells at intervals of a string in column C
vb Code:
cnt = Application.WorksheetFunction.CountIf("c:c", "SICOM")
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 14th, 2010, 08:03 AM
#4
Thread Starter
Lively Member
Re: counting the number of cells at intervals of a string in column C

Thanks I'll try that out.
Here's an example..
I'm trying to calculate the number of cells from the first 'XICOOMM' to the next 'XICOOMM'.
I wanna fill up the first 2 column with primary keys for referencing.
and then the XICOOMM at ie, row 50.. to the very next XICOOMM.
the data generated only states the primary key once, somewhere above the data in column say 'E'.
Thank you!
-
Apr 14th, 2010, 08:42 AM
#5
Re: counting the number of cells at intervals of a string in column C
Lets say the data is in Cell A1 to A15
Non VBA Method
=CountA(A1:A15)
The above formula will give you the number of cells which has alphanumeric values in the cells. If you want to exclude the two cells which have XICOOMM then the above formula becomes
=CountA(A1:A15) - 2
VBA Method
Application.WorksheetFunction.CountA("A1:A15") will give you the same results as above. Subtracting two will be required if you want to exclude the cells which contain XICOOMM.
Hope this is what you wanted?
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
-
Apr 14th, 2010, 09:19 AM
#6
Thread Starter
Lively Member
Re: counting the number of cells at intervals of a string in column C
hey that is close, however i need the formula to read the 'XICOOMM' text..
so from 1st XICOOMM to next (2nd XICOOMM), perform a count
from 2nd XICOOMM to the next (3rd XICOOMM; count.
Thank you
-
Apr 14th, 2010, 10:20 AM
#7
Re: counting the number of cells at intervals of a string in column C
Do you also want to count the empty cells between cells which have XICOOMM?
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
-
Apr 14th, 2010, 11:12 AM
#8
Thread Starter
Lively Member
Re: counting the number of cells at intervals of a string in column C
yea no harm in that! =)
i just need to prepare the data such that it has a primary key.
the primary key is only stated once in column d~
gotta have a formula to fill in column A or B
-
Apr 14th, 2010, 11:21 AM
#9
Re: counting the number of cells at intervals of a string in column C
One last question. Do you want to use VBA or Non VBA Method?
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
-
Apr 15th, 2010, 01:49 AM
#10
Thread Starter
Lively Member
Re: counting the number of cells at intervals of a string in column C
i would like to explore both~
-
Apr 15th, 2010, 05:31 AM
#11
Re: counting the number of cells at intervals of a string in column C
looks like you need to use excels find method to find xicooom, then findnext to find the next occurance, calculate the rows between
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 15th, 2010, 07:30 AM
#12
Re: counting the number of cells at intervals of a string in column C
Perhaps this does not help much:
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
|