当前位置:网站首页>VB learning notes
VB learning notes
2022-06-25 01:10:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
This month, due to the need of work , I learned a little VB.net operation Excel, Take notes
vb The subscript inside
vb There are three kinds of subscripts inside :
- from 0 Start : When we're in vb When defining an array in , Subscripts can only be from 0 Start
Dim arr(2) as StringMedium arr The array length is3Notice that it's not2Dim arr(1 to 10) as StringMay be an errorThe lower bound of an array can only be 0
- from 1 Start : Mainly used from 0 Exceptions will be thrown at first collections such as Tabs, Pages, Controls(listBox, TextBox),Excel The complex type subscripts are all from 1 Start
- Dictionary type Subscripts are key values
Try to use... In your code LBound and UBound To get the minimum and maximum subscripts of the array , It can be used in modules option base 1 To specify the subscript from 1 Start
VBA Detailed explanation of array subscript VBA option base Use
About Excel lastUsedRow and lastUsedColumn
Excel in Worksheet.UsedRange.Rows Refer to Excel The number of rows from the first non empty row to the last non empty row in the workbook R, So if there is a blank line in the workbook at the beginning , The final result returned is 「R – Number of empty lines at the beginning 」, So it may not be what we expected .
So don't rely on Worksheet.UsedRange.Rows To get the last line, you should use the reference link method
Why? vb Use in Worksheet.UsedRange.Rows.Count The result is wrong
About vb Exception handling
VB Use in try catch Capture exception , Use throw Throw an exception .
But if there are two classes in two modules , Want to be in A Class module B Class and capture B Exception of class function , Will give a warning :Exception Type exception in 「 modular 2」 Occurs in but is not processed
# modular 1
Public Class Test1
Private T = new Class Test2
Private Sub test1()
Try
T.Test()
Catch ex as Exception
MsgBox(ex.message)
End Try
End Sub
End Class
# modular 2
Public Class Test2
Public Sub Test()
Throw new Exception(“error”)
End Sub
End ClassPublisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151918.html Link to the original text :https://javaforall.cn
边栏推荐
- Activity lifecycle
- Golang example renewal lock: redis+channel+sync Mutex
- Text editor for QT project practice - Episode 12
- Contentresolver, get the SMS content
- Previous basic review (link)
- 改造一下 BeanUtils,优雅的实现 List 数据拷贝
- [micro service sentinel] real time monitoring | RT | throughput | concurrency | QPS
- 汇编语言(3)16位汇编基础框架与加减循环
- A small crawler program written by beginners
- 丹麥技術大學首創將量子計算應用於能源系統潮流建模
猜你喜欢

使用 Loki 微服务模式部署生产集群

Use of file class filenamefilter & filefilter in io

丹麥技術大學首創將量子計算應用於能源系統潮流建模

Custom control - round dot progress bar (imitating one key acceleration in security guard)
![[microservices sentinel] cluster link | microservices cluster environment construction](/img/75/3cc6abf1e72d651b082415db9db46c.png)
[microservices sentinel] cluster link | microservices cluster environment construction

I brush the question I - copy the linked list with random pointer

Scala IO read by line

I 刷题 I — 复制带随机指针的链表

汇编语言(3)16位汇编基础框架与加减循环

图书馆管理系统代码源码(php+css+js+mysql) 完整的代码源码
随机推荐
Mobile security tool apktool
ImageView展示网络图片
2022熔化焊接与热切割复训题库模拟考试平台操作
Syntax highlighting of rich text
Using bindservice method to pause music playing
I brush the question I - copy the linked list with random pointer
启动服务11111
Practical operation notes - notebook plus memory and ash cleaning
【微服务|Sentinel】簇点链路|微服务集群环境搭建
Première application de l'informatique quantique à la modélisation des flux de puissance dans les systèmes énergétiques à l'Université technique danoise
The acceleration of 100 km is only 5.92 seconds, and the willanda high-performance version leads with the strength of high-energy products
热力图展示相关矩阵
I'd like to ask how to open an account at industrial securities? Is it safe to open a stock account through the link
Scala trait inheritance class
卷积与反卷积关系超详细说明及推导(反卷积又称转置卷积、分数步长卷积)
Preliminary understanding of qtoolbutton
ContentResolver,拿到手机短信内容
Introduction to smart contract security audit delegatecall (2)
Text editor for QT project practice - Episode 12
Punch smart spirit 1. The brand is attractive. What is the strength of the product?