rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I have a macro started that opens a separate workbook and directs the user to the correct page. I want the macro to display a message box to tell the user to select a row, by clicking on the line number in column A, and then clicking "OK" on my message box. This means I need the user to be able to access the scroll bar and the worksheet behind the message/input box.
Once a row has been selected I have the remainder of the macro written to copy the correct cells over to my main worksheet.
I just do not know how to write the message/input box that would allow for user interaction and then complete my macro. I have posted what I have below.
Thanks for the help.
Robert
Once a row has been selected I have the remainder of the macro written to copy the correct cells over to my main worksheet.
I just do not know how to write the message/input box that would allow for user interaction and then complete my macro. I have posted what I have below.
Thanks for the help.
Robert
Code:
Sub Data_transfer()
Application.ScreenUpdating = False
File1 = ActiveWorkbook.Name
ChDir "\\Ferrari\common\Product QC\BioPrep QC\PrepaCyte-CB\PrepaCyte-CB QC\510k Lot Testing\PCB QC Trendline Data"
Workbooks.Open Filename:= _
"\\Ferrari\common\Product QC\BioPrep QC\PrepaCyte-CB\PrepaCyte-CB QC\510k Lot Testing\PCB QC Trendline Data\Master Cryobag Testing Log.xlsm"
Sheets("Main Log Data").Activate
'Select the correct row
I = MsgBox("Select the line number of the row that contains the " & vbCrLf & "testing results for the cryobag used by lot# " & Sheets("Intro Page").Range("T21").Value & vbCrLf & "Click ""OK"" When the line number has been selected.", vbOkayonly + vbExclamation)
'**** AFTER SELECTION HAS BEN MADE *****
ActiveSheet.Unprotect Password:="bioe1025"
Range("AA5").Value = ActiveCell.Value
Workbooks(File1).Sheets("Cryobag Testing
Summary").Range("AA5:AE5").Value = Workbooks("Master Cryobag Testing Log.xlsm").Sheets("Main Log Data").Range("AA5:AE5").Value
Range("AA5").ClearContents
ActiveSheet.Protect Password:="bioe1025"
ActiveWorkbook.Save
ActiveWorkbook.Close
Workbooks(File1).Activate
Application.ScreenUpdating = True
End Sub