|
-
Aug 2nd, 2008, 06:20 AM
#1
Thread Starter
PowerPoster
find in internal string
If Not .Sheets(I).Name Like "*sbilanci*" Then
ecc...
I have many sheets in wbiook.
I jave maked a code to exclude for coindition all sheet contai the word Sbilanci... but the liner of code not intercept the condition!!!!
I can have in wbook a sheets named similar:
Sbilanci_001
460_sbilanci
re_sbilanci_34
in effect i want to controll in all position of string sheet name the word sbilanci
-
Aug 2nd, 2008, 06:43 AM
#2
Re: find in internal string
Use INSTR()
for example
assuming that you have defined Exlbook
vb Code:
Sub aaa()
For i = 1 To Exlbook.Sheets.Count
'vbTextCompare will ensure that even Sbilanci(with a capital S)
'is also picked up.
If InStr(1, Exlbook.Sheets(i).Name, "sbilanci", vbTextCompare) Then
MsgBox Exlbook.Sheets(i).Name
End If
Next i
End Sub
Hope this helps...
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
-
Aug 2nd, 2008, 07:14 AM
#3
Thread Starter
PowerPoster
Re: find in internal string
koolsid i love you!
Tks from Napoli. Virtual Pizza for you!
-
Aug 2nd, 2008, 07:16 AM
#4
Thread Starter
PowerPoster
Re: find in internal string
 Originally Posted by koolsid
Use INSTR()
for example
assuming that you have defined Exlbook
vb Code:
Sub aaa()
For i = 1 To Exlbook.Sheets.Count
'vbTextCompare will ensure that even Sbilanci(with a capital S)
'is also picked up.
If InStr(1, Exlbook.Sheets(i).Name, "sbilanci", vbTextCompare) Then
MsgBox Exlbook.Sheets(i).Name
End If
Next i
End Sub
Hope this helps...
koolsid i "love you!"
Tks from Napoli. Virtual Pizza for you!
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
|