1 réponse
I work on Excel and here is a piece of code that I hope will help you
Sheets("Sheet1").Columns(1).Replace " ", ","
This code allows you to replace all spaces in sheet 1 of column A with a comma.
Otherwise, my goal is to process data from a txt file that I need to insert into my Excel table.
So I insert the data line by line.
Open fich For Input As #1
l = 0
Do Until EOF(1)
Line Input #1, data
data = Replace$(data, vbTab, "!")
ActiveCell.offset(l, 0) = data
l = l + 1
Loop
Close #1
This opens my file, inserts line by line, and before that replaces all tabs with an exclamation mark.
Good luck
see you later
Sheets("Sheet1").Columns(1).Replace " ", ","
This code allows you to replace all spaces in sheet 1 of column A with a comma.
Otherwise, my goal is to process data from a txt file that I need to insert into my Excel table.
So I insert the data line by line.
Open fich For Input As #1
l = 0
Do Until EOF(1)
Line Input #1, data
data = Replace$(data, vbTab, "!")
ActiveCell.offset(l, 0) = data
l = l + 1
Loop
Close #1
This opens my file, inserts line by line, and before that replaces all tabs with an exclamation mark.
Good luck
see you later
- a space in the Find field
- ^t in the Replace with field, and all your spaces will be replaced by a tab, which will allow you to retrieve all your data in Excel.