I’m a newbie and I’m trying to learn VBA and i got a question about this code:
(Sorry for any mistake in English, I’m not a native speaker)
Option Explicit
Type rPaciente 'matriz de pacientes
CodPaciente As Long
PriorPaciente As Long
IntvChegDistr As String
Par1 As Double
Par2 As Double
Par3 As Double
Par4 As Double
IntvCheg As Double
InstCheg As Double
End Type
Public mPaciente() As rPaciente
Public glQtdPaciente As Long
What are these “things” between Type and End Type, are they cells of the range of my worksheet, cause I got columns like Par1,Par2,…,Par4 in my worksheet but I don’t got columns named IntvCheg neither InstCheg. And what does the command Public someting() As otherthing means?
Thanks in advance for your help.
“Things” between
TypeandEnd Typeare members of therPacientetype. They are not mapped to anything, they only describe the set of data this type is meant to contain.Probably there is a routine somewhere that maps the cells on your sheet to members of this type by creating an instance of the type and copying values from the sheet to the member variables of the instance.
Public someting() As otherthingis an array of typeotherthing. The declaration does not include the dimensions for the array, so before it can be used, you mustReDimit to something: