View Full Version : find last alphanumeric row of .txt file and fill into excel cell
nalsur88
06-12-2022, 06:15 PM
hello to all, I'm new in this forums
currently we enter manually the serial numbers and always double the number and very hard to find in list,
my idea is, create 1 button "NEW" and 1 for "SAVE" , and csv (serial_number.csv) file have serial# for beginning start with TTR000001, user press button "NEW" then create new number and place in cell B1 according to last serial number in csv file, SAVE button is save new serial number to csv file below last numbers.
3922
thanks hope someone to help with vba macro
the serial_number.csv file
3923
DocAElstein
06-13-2022, 02:46 PM
Hello nalsur88
Welcome to ExcelFox :)
hello to all, I'm new in this forums
Many forums are similar, we are a bit different at excelfox.com in that we usually are interested in helping people solve their own problems and to help them learn.
If you need to get a full solution quickly, and have less time or interest in learning, then a larger forum such as excelforum.com or mrexcel.com is worth a try – there are many 100 people there happy to give you a lot of quick solutions and free coding.
(You might need to try and improve your explanation: I expect your mother tongue is not English, and your written explanation is a bit hard to understand).
... ..we enter manually the serial numbers and always double the number and very hard to find in list, -- :confused:
...... csv (serial_number.csv) file have serial# for beginning start with TTR000001,
.....button "NEW" then create new number and place in cell B1 according to last serial number in csv file,
.....SAVE button is save new serial number to csv file below last numbers.
....... the serial_number.csv file
I think I probably do not understand fully, but understand enough to get you started.
I will give you a couple of macros to do these two things
_1) create new number and place in cell B1 according to last serial number in csv file,
_2) save new serial number to csv file below last numbers.
_1) create new number and place in cell B1 according to last serial number in csv file,
VBA typically allows us to use string variables that look like numbers in number calculations. This convenience means that an attractive solution is to do some string manipulation to get at the number we require.
We will take the entire single string of the text file into VBA and then manipulate it to get the required number
Answer – see here
https://excelfox.com/forum/showthread.php/2559-Notes-tests-text-files-manipulation-of-text-files-in-Excel-and-with-Excel-VBA?p=16632&viewfull=1#post16632
_2) save new serial number to csv file below last numbers.
The required here macro can use very similar things to the previous one.
Answer – see here
https://excelfox.com/forum/showthread.php/2559-Notes-tests-text-files-manipulation-of-text-files-in-Excel-and-with-Excel-VBA?p=16634&viewfull=1#post16634
Alan
nalsur88
06-13-2022, 04:19 PM
Hi DocAElstein
Thanks for your explanation.
DocAElstein
06-13-2022, 05:24 PM
You are welcome.
( I forgot to say, - to test the macros, you will need to save the Excel File and the csv File in the same place.
( And did you notice I also tested the two macros here: -
https://excelfox.com/forum/showthread.php/2559-Notes-tests-text-files-manipulation-of-text-files-in-Excel-and-with-Excel-VBA?p=16634&viewfull=1#post16634
https://excelfox.com/forum/showthread.php/2559-Notes-tests-text-files-manipulation-of-text-files-in-Excel-and-with-Excel-VBA?p=16632&viewfull=1#post16632 )
nalsur88
06-13-2022, 05:55 PM
You are welcome.
( I forgot to say, - to test the macros, you will need to save the Excel File and the csv File in the same place.
( And did you notice I also tested the two macros here: -
https://excelfox.com/forum/showthread.php/2559-Notes-tests-text-files-manipulation-of-text-files-in-Excel-and-with-Excel-VBA?p=16634&viewfull=1#post16634
https://excelfox.com/forum/showthread.php/2559-Notes-tests-text-files-manipulation-of-text-files-in-Excel-and-with-Excel-VBA?p=16632&viewfull=1#post16632 )
Yes tested the files in 1 folder, worked perfectly
Thanks
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.