Hi All, I need help with following:
I have three workbook. Workbook-1 Master Data File (Picture below)). Workbook-2 dataFORM-1 and Workbook-3 dataFORM-2.
Data FORM 1 and 2 send data to Master Data File using following code. When FORM-1 send data to Master Data file its occupied cell A2 to AD2, when data from FORM-2 arrived its insert one row down that is in AE3 instead of AE2, I wants data to be inserted next available column which is AE2. How to achieve that within below code . Also I want to close Master Data File automatically when Data FORM is closed.
Following code using in Data FORM-2 also same code use in Data FORM-1.
Private Sub CommandButton1_Click() Dim quotationNo As String Dim myData As Workbook ‘Worksheets(“Sales Invoice 1”).Select quotationNo = Range(“K6”) ‘Worksheets(“Sales Invoice 1”).Select – this line may not be necessary Set myData = Workbooks.Open(“C:\EXcel\CustData.xlsm”) Worksheets(“sheet2”).Select Worksheets(“sheet2”).Range(“A1”).Select RowCount = Worksheets(“sheet2”).Range(“A1”).CurrentRegion.Rows.Count With Worksheets(“Sheet2”).Range(“A1”) .Offset(RowCount, 30 ) = quotationNo End With myData.Save End Sub