PDA

Click to See Complete Forum and Search --> : current position on the current line


big_k105
Oct 17th, 2003, 02:56 PM
ok my question is that i have a textbox on a worksheet in excel and i want to be able to find out what the current position on the current line that im on. here is what im trying to do. ok i am first off converting a file from a emacs file to beable to be read and looked at in windows. and the tab stops to look right in windows. in emacs it make the tabs 8 spaces long and for some reason they are only like 5-6 or so in the textbox. and i want to beable to take a chr(9) which is tab and replace it with space(8) but here is where the problem is.

when you are in the first space on a line it and hit tab in emacs it moves over 8. then of you are on the 2nd it moves over 7 and goes to the same spot as the last tab this happens all the way over to space 8 where it starts over. and i need to be able to detect want spot the chr(9) was found on so i know how many spaces to go over. well hopefully someone can help. i currently dont have any code writen really. all i have is the code the replaces all chr(9) with space(8) if you want i can post that so you can look at how i do stuff.

well thanks for your help and hope you read this soon thanks :)

big_k105
Oct 17th, 2003, 06:36 PM
'***********************************************'
' code that replaces the chr(9)'s with space(8) '
'***********************************************'
Dim curpos1 As Integer
thispos1 = 0
thispos1 = 0
startpos1 = 1
startpos2 = 1
'chr(9) replacing with 8 spaces
Do While True
thispos1 = InStr(startpos1, strFileRecord, Chr(9))
If thispos1 = 0 Then Exit Do
strFileRecord = Left(strFileRecord, thispos1 - 1) & space(8) & Mid(strFileRecord, thispos1 + 8)
startpos1 = thispos1 + 1
Loop
'***********************************************'
' code that replaces the chr(9)'s with space(8) '
'***********************************************'

big_k105
Oct 24th, 2003, 04:54 PM
*bump*