Hello everyone, I am not an expert and need help please!
I have a macro button [Get Outlook Data] on a worksheet that when clicked allows you to choose the folder in Outlook and then the data is shown on my worksheet 'Outlook Results'. Each time the macro runs it clears the previous data from worksheet 'Outlook Results', that is required.
The problem is the data needs to be copied to a worksheet 'Results History' and to the next blank line every time data is generated via [Get Outlook Data] button. Not been able to figure this out after several attempts. I have shown the code just before and after where it clears the contents.
Many thanks
I have a macro button [Get Outlook Data] on a worksheet that when clicked allows you to choose the folder in Outlook and then the data is shown on my worksheet 'Outlook Results'. Each time the macro runs it clears the previous data from worksheet 'Outlook Results', that is required.
The problem is the data needs to be copied to a worksheet 'Results History' and to the next blank line every time data is generated via [Get Outlook Data] button. Not been able to figure this out after several attempts. I have shown the code just before and after where it clears the contents.
VBA Code:
Dim numRows As Long
Dim startRow As Long
Dim jAttach As Long ' counter for attachments
Dim debugMsg As Integer
' select output results worksheet and clear previous results
Sheets("Outlook Results").Select
Sheets("Outlook Results").Cells.ClearContents
Range("A1").Select
Set objOutlook = CreateObject("Outlook.Application")
'MsgBox objOutlook, vbOKOnly 'for debugging
Set objNamespace = objOutlook.GetNamespace("MAPI")
Many thanks