in Education by
I want to transfer the contents from part of the a 'Type' array to an excel range (see example below), but get 'Invalid Qualifier' error. Any help would be appreciated? Public Type typDetails firstName As String lastName As String End Type Dim userDetails(100) As typDetails Public Sub test() userDetails(0).firstName = "Bob" userDetails(0).lastName = "Bobson" userDetails(1).firstName = "Bob" userDetails(1).lastName = "Bobson" userDetails(2).firstName = "Bob" userDetails(2).lastName = "Bobson" Worksheets(1).Range("A1:A3") = userDetails.firstName End Sub Thanks in advance, Alex. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Think you need a loop: Public Sub test() Dim i As Long userDetails(0).firstName = "Bob" userDetails(0).lastName = "Bobson" userDetails(1).firstName = "Bob" userDetails(1).lastName = "Bobson" userDetails(2).firstName = "Bob" userDetails(2).lastName = "Bobson" For i = 0 To 2 Worksheets(1).Cells(1, i + 1).Value = userDetails(i).firstName Next i End Sub

Related questions

0 votes
    I've got these Named Ranges that work fine. But they are reversed from the get go because of how ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    In Excel, which function returns the total of the range values? * O ADD() O &() O SUMC) Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    How to specify cell range from A10 to A 25 in MS Excel? (a) (A10-A25) (b) (A10 to A25) (c) (A10 : A25) (d) (A10 . A25) (e) (A10 A25) Select the correct answer from above options...
asked Dec 12, 2021 in Education by JackTerrance
0 votes
    which option is used to restrict the cell entries within a specified range in excel? Select the correct answer from above options...
asked Dec 2, 2021 in Education by JackTerrance
0 votes
    How do I use the CAST in ADO to convert Float values to String? I tried SELECT CAST([Field] AS ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I've to solve a problem regarding generics which gives me quite the stomache ache. Basically it's supposed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I've to solve a problem regarding generics which gives me quite the stomache ache. Basically it's supposed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Suppose that you have an array consisting of several objects. This object is of the type string. Let this string be ... the character array arr'. How will you carry this out?...
asked Oct 16, 2020 in Technology by JackTerrance
0 votes
    What are the differences between Source Qualifier and Joiner Transformation?...
asked Mar 27, 2021 in Technology by JackTerrance
0 votes
    Differentiate between Source Qualifier and Filter Transformation?...
asked Mar 27, 2021 in Technology by JackTerrance
0 votes
    What is the use of source qualifier?...
asked Mar 26, 2021 in Technology by JackTerrance
0 votes
    What is the range of short data type in Java? (a) -128 to 127 (b) -32768 to 32767 (c) - ... , java programming questions and answers pdf, java interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    What is the range of byte data type in Java? (a) -128 to 127 (b) -32768 to 32767 (c) - ... , java programming questions and answers pdf, java interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    The range of INTEGER or INT data type is _____________. Please select the correct options from below (a)-32,768 to 32,767 (b)None ... 854,775,807 (d)-2,147,483,648 to 2,147,483,647...
asked Dec 11, 2020 in Education by Editorial Staff
...