Im trying to write a progam that takes text out of a text box named data5 that is in a excel document that which I have defined as workbooks(fileName).worksheet(1).I want to take that string and save is a lastTextbox and put it in a another excel document that is called Clients1 at cell(i,3). no matter what I try I cant get the vb progam to see and read that data in textbox data5.
btw everything is in different workbooks
I have tried everything I can think of weather it is the .range method or
focus(). but there is always a problem getting the actual text form the text box in a different document. can someone plz help me
Do While fileName <> ""
i = i + 1
j = 2
jj = j + 1
Cells(i, 1) = fileName
Cells(i, 2) = lastTextbox
Application.ScreenUpdating = False
Workbooks.Open (directory & fileName)
' Workbooks(directory & fileName).Worksheets(1).data5.Focus()
firstChr = data5.selectionStart = 0
lastTextbox = data5.SelectionLength = data5.Text.Length
Workbooks.Open (directory & "clients1.xlsx")
For Each sheet In Workbooks(fileName).Worksheets
btw everything is in different workbooks
I have tried everything I can think of weather it is the .range method or
focus(). but there is always a problem getting the actual text form the text box in a different document. can someone plz help me
Do While fileName <> ""
i = i + 1
j = 2
jj = j + 1
Cells(i, 1) = fileName
Cells(i, 2) = lastTextbox
Application.ScreenUpdating = False
Workbooks.Open (directory & fileName)
' Workbooks(directory & fileName).Worksheets(1).data5.Focus()
firstChr = data5.selectionStart = 0
lastTextbox = data5.SelectionLength = data5.Text.Length
Workbooks.Open (directory & "clients1.xlsx")
For Each sheet In Workbooks(fileName).Worksheets