{"id":2777,"date":"2018-11-22T13:34:57","date_gmt":"2018-11-22T12:34:57","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=2777"},"modified":"2018-11-22T13:41:37","modified_gmt":"2018-11-22T12:41:37","slug":"vba-dynamische-string-array-dynamic-string-array-in-vba","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=2777","title":{"rendered":"Visual Basic und VBA: Dynamische String Array \/ Dynamic string array in VBA"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>In VBA soll ein dynamisches String-Array verwendet werden.<\/p>\n<h1>Solution &#8211; L\u00f6sung<\/h1>\n<p>Array initialisieren:<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n      Dim cbValuesStringArray() As String\r\n\r\n      While i&lt;10\r\n        i = i + 1\r\n        ReDim Preserve cbValuesStringArray(i - 1)\r\n        cbValuesStringArray(i - 1) = CStr(i)\r\n      End While\r\n<\/pre>\n<p>Array auslesen:<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n    For j = 0 To UBound(cbValuesStringArray)\r\n        Debug.Print CStr(j) &amp; &quot; - &quot; &amp; cbValuesStringArray(j)\r\n    Next j\r\n<\/pre>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D2777&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px;margin-top:5px;\"><\/iframe>","protected":false},"excerpt":{"rendered":"<p>Problem In VBA soll ein dynamisches String-Array verwendet werden. Solution &#8211; L\u00f6sung Array initialisieren: Dim cbValuesStringArray() As String While i&lt;10 i = i + 1 ReDim Preserve cbValuesStringArray(i &#8211; 1) cbValuesStringArray(i &#8211; 1) = CStr(i) End While Array auslesen: For j = 0 To UBound(cbValuesStringArray) Debug.Print CStr(j) &amp; &quot; &#8211; &quot; &amp; cbValuesStringArray(j) Next j<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12],"tags":[],"class_list":["post-2777","post","type-post","status-publish","format-standard","hentry","category-vba"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-IN","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2777"}],"version-history":[{"count":8,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2777\/revisions"}],"predecessor-version":[{"id":2787,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2777\/revisions\/2787"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}