Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2021, 07:38 AM
SamDsouza SamDsouza is offline Subscript out of Range Error when searched for string and its line number in Text File Windows 10 Subscript out of Range Error when searched for string and its line number in Text File Office 2013
Advanced Beginner
Subscript out of Range Error when searched for string and its line number in Text File
 
Join Date: Aug 2019
Posts: 71
SamDsouza is on a distinguished road
Default

This is the following structure of the original txt file:
Quote:
Name Tom
Age 13

Name John
Age 15

Name Jack
Age 16

Name Michael
Age 12
Hey as per your format i quickly changed the Data of Text File to:


Quote:
Name "Tom"
Age "13"
DOB "27/12/1993"

Name "John"
Age "15"
DOB "15/12/1991"

Name "Jack"
Age "16"
DOB "05/08/1990"

Name "Michael"
Age "12"
DOB "25/02/1994"

Name "Martin"
Age "33"
DOB "30/12/1980"

Name "George"
Age "43"
DOB "15/12/1970"
1. Yes indeed it reads the 1st date but does not move on further and reads the other dates in msgbox

Another observation
2. for Eg if WhatToFind ="Name" then its First Record will show the Value of Age =13 rather than "Tom"
if WhatToFind ="Age" then its First Record will show the Value of Date 27/12/1993

SamD
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Declare wBk as workbook. Set wBk = workbooks("NewBook.xls") gives error: Subscript out of range. Syed Shabbir Excel Programming 1 09-27-2020 09:35 AM
Subscript out of Range Error when searched for string and its line number in Text File replace with text contains a group number which is out of range Error Message raghugada Word 6 05-30-2017 02:09 PM
Runtime error '9': Subscript out of Range KingoftheKassel Excel Programming 1 06-13-2016 08:00 PM
VBA Conditional Formatting Error (Subscript out of Range)) tinfanide Excel Programming 1 05-15-2015 08:12 AM
Subscript out of Range Error when searched for string and its line number in Text File Subscript out of range error KHTAY Excel 6 03-28-2009 11:18 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft