Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there!
could any one help me out from a problem in Excel-VBA. I want to update the row of a worksheet through user form. I did it successfully, but in the same workbook. Now the real problem is this I want to update the others workbook's worksheet. Here what I already did . Private Sub cmdAddStudent_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Students") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row 'check for a Student Name If Trim(Me.txtStudentName.Value) = "" Then Me.txtStudentName.SetFocus MsgBox "Please enter a Student Name" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = Me.txtStudentName.Value ws.Cells(iRow, 2).Value = Me.txtClassId.Value ws.Cells(iRow, 3).Value = Me.txtStudentID.Value ws.Cells(iRow, 4).Value = Me.txtRegNo.Value 'clear the data Me.txtStudentName.Value = "" Me.txtClassId.Value = "" Me.txtStudentID.Value = "" Me.txtRegNo.Value = "" Me.txtStudentName.SetFocus End Sub The code is working fine but i want to update the same record in another worksheet which is present in another workbook on network. The path for that file is \\sharedrive\ShareFile\Public\StuData.xls and Worksheet's name is Students please guys help me out. Saddat Sarfraz Saadi |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User form or embed in a worksheet | Excel Programming | |||
Modeless User Form and Worksheet Focus | Excel Programming | |||
Pulling information from a worksheet into a user form | Excel Programming | |||
Using user form to change cell value on worksheet | Excel Programming | |||
Edit worksheet while a user form is on? | Excel Programming |