So I am very new to VBA, and have been stuck on this one part for over 3 hours and can't find anything that helps online.
What I have already done is created a Userform that asked the person running the macro to input their lab series # then hit ok.
The macro automatically saves the file into a folder "N:\folder\data\" as TextBox.Value & ".xlsx".
Once it is saved as that, the macro opens another workbook of data and copies selected cells out of that.
I would like to take that copied data, open up the already created workbook and paste the data into that workbook.
The code I am trying to use is
<!-- BEGIN TEMPLATE: bbcode_code -->
Code:
<STYLE>.alt2 font {font: 11px monospace !important;color: #333 !important;}</STYLE>
Range("K1").Select Range(Selection, Selection.End(xlDown)).Select ActiveWindow.SmallScroll Down:=-30 Range("K1:K68,N1").Select Range("N1").Activate Range(Selection, Selection.End(xlDown)).Select Range("K1:K68,N1:P68").Select Range("N1").Activate Selection.Copy Workbooks.Open "N:\MATDEV\MasterCurve Data\" & TextBox.Value & ".xlsx" Sheet1.Activate Selection.Paste</PRE><!-- END TEMPLATE: bbcode_code -->And I keep getting a slurry of different errors, everytime I try something different. The main one being "Run-time error 424- Object Required"
Any help would be greatly appreciated. It doesn't seem like it should be that hard, but I can't figure it out and feel like I've tried everything.
Thanks in advance
What I have already done is created a Userform that asked the person running the macro to input their lab series # then hit ok.
The macro automatically saves the file into a folder "N:\folder\data\" as TextBox.Value & ".xlsx".
Once it is saved as that, the macro opens another workbook of data and copies selected cells out of that.
I would like to take that copied data, open up the already created workbook and paste the data into that workbook.
The code I am trying to use is
<!-- BEGIN TEMPLATE: bbcode_code -->
Code:
<STYLE>.alt2 font {font: 11px monospace !important;color: #333 !important;}</STYLE>
Range("K1").Select Range(Selection, Selection.End(xlDown)).Select ActiveWindow.SmallScroll Down:=-30 Range("K1:K68,N1").Select Range("N1").Activate Range(Selection, Selection.End(xlDown)).Select Range("K1:K68,N1:P68").Select Range("N1").Activate Selection.Copy Workbooks.Open "N:\MATDEV\MasterCurve Data\" & TextBox.Value & ".xlsx" Sheet1.Activate Selection.Paste</PRE><!-- END TEMPLATE: bbcode_code -->And I keep getting a slurry of different errors, everytime I try something different. The main one being "Run-time error 424- Object Required"
Any help would be greatly appreciated. It doesn't seem like it should be that hard, but I can't figure it out and feel like I've tried everything.
Thanks in advance