Advanced programming in VBA-Excel for beginners: With examples of DLL libraries and Add-Ins in Visual Basic .NET by Oria Dorian
Author:Oria, Dorian [Oria, Dorian]
Language: eng
Format: epub
Published: 2018-09-07T16:00:00+00:00
2
Dim r, c As Integer 'r: rows, c: columns
3
With Worksheets("matrices")
4
For r = 1 To 3
5
For c = 1 To 3
6
.Range("G1").Offset(r - 1, c - 1) = .Range("B1").Offset(c - 1, r - 1)
7
Next c
8
Next r
9
End With
10
End Sub
To write the transposed matrix, we have used cell G1 as a pivot and from there we count rows and columns (it is important to note that the rows expand downwards and the columns to the right). When the variables "r" and "c" are equal to 1, then the offset is (0,0), that is, it refers to the same cell G1. From there, we move along the columns (For-Next loop of the variable "c") and then along the rows (For-Next loop of the variable "r").
This form has the advantage that Excel, by default, calls its cells with the notation of letters and numbers. As shown by the previous code, it is easy to locate within the sheet and from there move to the adjacent cells using the offset property. When the Cells notation is used, it is necessary to know the column number, which can be a bit tedious, at least for me. However, it is possible that for many of those who are involved with mathematics, the Cells notation may be more comfortable for them.
9.4
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
NET | C & C++ Windows Programming |
SQL Server | VBA |
Visual Basic |
Deep Learning with Python by François Chollet(11922)
Hello! Python by Anthony Briggs(9388)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9353)
The Mikado Method by Ola Ellnestam Daniel Brolund(9321)
Dependency Injection in .NET by Mark Seemann(8867)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7860)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7351)
Grails in Action by Glen Smith Peter Ledbrook(7305)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7126)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5969)
Kotlin in Action by Dmitry Jemerov(4654)
Practical Vim (for Kathryn Amaral) by Drew Neil(3733)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(3602)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3450)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3252)
Learning Java by Patrick Niemeyer & Daniel Leuck(2874)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2847)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(2843)
Microservices with Go by Alexander Shuiskov(2636)