|
-
Jan 17th, 2001, 09:27 AM
#1
Thread Starter
Member
Hi,
The following is the program i have written to input data into Excel using VB.It is working fine for inoutting one value for a particular cell.BUT i want to make it work like a database entry i.e i WANT TO USE A SINGLE TEXTBOX TO MAKE ENTRIES INTO SAY INCREASING ROW NUMBER(i.e row1,2,3..).I have tried using 'for' statement for incrementing row number but it doesn't seem to work.
Private Sub Command1_Click()
Dim XLApp As New Excel.Application
Dim i As Integer
XLApp.Workbooks.Open ("C:\My Documents\1.xls")
XLApp.Visible = True
Text1.SetFocus
For i=1 to 10
XLApp.Cells(i, 1) = Text1.Text
XLApp.ActiveWorkbook.Save
ReadOnlyRecommended = False
CreateBackup = False
Text1 = ""
Next i
XLApp.Workbooks.Close
Set XLApp = Nothing
End Sub
Please help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|