Hi all!
I've created a user form in which I submit data on orders i'm following up on. 5 other co workers have a copy of that workbook. Every time we click the "Submit" button on the user form, it adds the form data to the next blank row in the current workbook, but it ALSO adds the form data to the next blank row in a closed workbook called "Hub". The idea is that we can all update the "Hub" sheet with out running into a "read only" issue.
Now, i need to take the data from the "Hub" sheet and update all the User workbooks with any new data that was added to "Hub". I'd like this to happen when a user opens his/her User Form.
I've messed around with a few different codes, but they seem overly complicated when I feel like this be pretty simply.
Copy used range from Hub > add data to current workbook starting in first blank cell in Column A
I read the below article, and my main concern is the range address differs every day. My goal is to have every User workbook updated as often as possible with data from the "Hub" workbook[h=1]Copy range from closed workbook and paste into active workbook[/h]
I like the below code, but i don't want anyone to have to manually select the file, could someone guide me into modifying this to a specific workbook or point me in a general direction?
[Sub ImportDatafromcloseworkbook()'Update 20150707
Dim xWb As Workbook
Dim xAddWb As Workbook
Dim xRng1 As Range
Dim xRng2 As Range
Set xWb = Application.ActiveWorkbook
xTitleId = "KutoolsforExcel"
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel 2007-13", "*.xlsx; *.xlsm; *.xlsa"
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
Application.Workbooks.Open .SelectedItems(1)
Set xAddWb = Application.ActiveWorkbook
Set xRng1 = sh4.Range(Rows.Count, 1).End(xlUp).Row
xWb.Activate
Set xRng2 = Range("A1").End(xlDown).Offset(1, 0).Select
xRng1.Copy xRng2
xRng2.CurrentRegion.EntireColumn.AutoFit
xAddWb.Close False
End If
End With
End Sub]
I've created a user form in which I submit data on orders i'm following up on. 5 other co workers have a copy of that workbook. Every time we click the "Submit" button on the user form, it adds the form data to the next blank row in the current workbook, but it ALSO adds the form data to the next blank row in a closed workbook called "Hub". The idea is that we can all update the "Hub" sheet with out running into a "read only" issue.
Now, i need to take the data from the "Hub" sheet and update all the User workbooks with any new data that was added to "Hub". I'd like this to happen when a user opens his/her User Form.
I've messed around with a few different codes, but they seem overly complicated when I feel like this be pretty simply.
Copy used range from Hub > add data to current workbook starting in first blank cell in Column A
I read the below article, and my main concern is the range address differs every day. My goal is to have every User workbook updated as often as possible with data from the "Hub" workbook[h=1]Copy range from closed workbook and paste into active workbook[/h]
I like the below code, but i don't want anyone to have to manually select the file, could someone guide me into modifying this to a specific workbook or point me in a general direction?
[Sub ImportDatafromcloseworkbook()'Update 20150707
Dim xWb As Workbook
Dim xAddWb As Workbook
Dim xRng1 As Range
Dim xRng2 As Range
Set xWb = Application.ActiveWorkbook
xTitleId = "KutoolsforExcel"
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel 2007-13", "*.xlsx; *.xlsm; *.xlsa"
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
Application.Workbooks.Open .SelectedItems(1)
Set xAddWb = Application.ActiveWorkbook
Set xRng1 = sh4.Range(Rows.Count, 1).End(xlUp).Row
xWb.Activate
Set xRng2 = Range("A1").End(xlDown).Offset(1, 0).Select
xRng1.Copy xRng2
xRng2.CurrentRegion.EntireColumn.AutoFit
xAddWb.Close False
End If
End With
End Sub]