daniels012
Well-known Member
- Joined
- Jan 13, 2005
- Messages
- 5,219
I copy data from Outlook.
I have a button on a spreadsheet that pastes the data from outlook into the proper cells on the spreadsheet.
The Problem!!! If the user forgets to copy the data from outlook it gives a Runtime Error 1004. Can I put in my code something to give a message to the user to "copy the data from Oulook. vbcrtl then hit the button again." and take the user back to cell B2 on the spreadsheet. Not sure where to put the message as well?
Below is the code:
Thank You,
Michael[/code]
I have a button on a spreadsheet that pastes the data from outlook into the proper cells on the spreadsheet.
The Problem!!! If the user forgets to copy the data from outlook it gives a Runtime Error 1004. Can I put in my code something to give a message to the user to "copy the data from Oulook. vbcrtl then hit the button again." and take the user back to cell B2 on the spreadsheet. Not sure where to put the message as well?
Below is the code:
Code:
Sub PasteContactInfo()
'
' PasteContactInfo Macro
' Copies Data from Outlook
'
'
Application.ScreenUpdating = False
ActiveWindow.SmallScroll Down:=48
Range("B61").Select
ActiveSheet.Paste
Range("B62").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-51
Range("D3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.SmallScroll Down:=51
Range("B63").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-54
Range("D5").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.SmallScroll Down:=51
Range("C63").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-48
Range("D10").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.SmallScroll Down:=45
Range("D63").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-51
Range("D6").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.SmallScroll Down:=48
Range("E63").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-51
Range("D7").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.SmallScroll Down:=48
Range("F63").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-51
Range("D8").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.SmallScroll Down:=48
Range("G63").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-45
Range("D9").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.SmallScroll Down:=45
Range("H63").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-51
Range("D2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWindow.SmallScroll Down:=-9
Application.ScreenUpdating = True
Range("B1").Select
End Sub
Thank You,
Michael[/code]