写一个VB程序,用来从字符串中筛选出字母字符并反序存放。

写一个VB程序,用来从字符串中筛选出字母字符并反序存放。,第1张

Private Sub Form_Click()

Dim a$, s() As Byte, i%, st$

a = InputBox("字符串", , "sfsjlh8900-='[jFDHRe223oi")

s = StrConv(a, vbFromUnicode)

For i = UBound(s) To 0 Step -1

If (s(i) > 64 And s(i) < 91) Or (s(i) > 96 And s(i) < 123) Then st = st & Chr(s(i))

Next

Print a

Print st

End Sub

楼主,每个透视表 *** 作上,根据实际的数据类型的什么,差别比较大的。

这儿也不好说怎么来做~

使用Excel 2010或2013,录制宏,然后 *** 作下透视表,就能看到具体怎么 *** 作了。

2007有Bug,不要用的好, *** 作的过程好多看不到。

我也做了好些自动筛选的,贴出来,你看下吧,不细说了,可以实现的。

'创建图表

Set cht = wbdSheets("PivotTable")ChartObjectsAdd(wbdSheets("PivotTable")Cells(1, "J")Left + 8, wbdSheets("PivotTable")Cells(1, "J")Top, 708, 284)

chtName = "图表1"

chtChartChartWizard Source:=tbTableRange1

chtChartSetElement (msoElementChartTitleAboveChart)

k = 0

'根据刷新的数据型号,判断取的不良Code

For Each lotype In tbPivotFields("Type")PivotItems

lotype_1 = lotype

tbPivotFields("Type")CurrentPage = lotype_1

'这个地方就是筛选设定的~~~

If UBound(Filter(pdt, lotype)) = 0 Then

tbPivotFields("DGS%")Orientation = xlHidden

tbPivotFields("GCS%")Orientation = xlHidden

tbPivotFields("GGS%")Orientation = xlHidden

tbPivotFields("Glass Qty")Position = 2

With chtChart

ChartTitleText = lotype_1 & "_Tray别Yield确认@Inv%"

ApplyChartTemplate ( _

"F:\Sputter Daily Report自动化\1图表模板\Tray_Yield_TNcrtx")

End With

Else

tbPivotFields("Inv%")Orientation = xlHidden

tbPivotFields("Glass Qty")Position = 4

With chtChart

ChartTitleText = lotype_1 & "_Tray别Yield确认@DGS/GCS/GGS%"

ApplyChartTemplate ( _

"F:\Sputter Daily Report自动化\1图表模板\Tray_Yield_ADScrtx")

End With

End If

'text1 对应你的输入字符串

'text2 对应的反序的字符串

'command1 对应的 分离并反序按钮

'command2 对应的清除按钮

'其中 a 对应的 ascii 码 为97 z 对应的 ascii 码 为122

'A 对应的 ascii 码 为65 Z 对应的 ascii 码 为90

Private Sub Command1_Click()

''计算反码

If Text1Text <> "" Then

For i = 0 To Len(Text1Text) - 1

c = Mid(Text1Text, Len(Text1Text) - i, 1)

If Asc(c) > 65 And Asc(c) < 90 Or Asc(c) > 97 And Asc(c) < 122 Then

''是字母,则输出显示

Text2Text = Text2Text & c

Else

End If

Next

End If

End Sub

Private Sub Command2_Click()

''清除

Text1Text = ""

Text2Text = ""

Text1SetFocus

End Sub

以上就是关于写一个VB程序,用来从字符串中筛选出字母字符并反序存放。全部的内容,包括:写一个VB程序,用来从字符串中筛选出字母字符并反序存放。、如何用vba实现数据透视表自动筛选、VB编写 编写一个程序,用来从字符串中筛选出字母字符并反序存放等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/10171472.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-06
下一篇 2023-05-06

发表评论

登录后才能评论

评论列表(0条)

保存