redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,604
- Office Version
- 365
- Platform
- Windows
No matter where I put the Application.Screenupdating function in this code, it still flickers when running,
Where should it be placed to avoid the 'flicker'
Thanks in advance
Where should it be placed to avoid the 'flicker'
VBA Code:
Sub CopyEbayData()
Dim sourceWorkbook As Workbook
Dim targetWorkbook As Workbook
Dim sourceWorksheet As Worksheet
Dim copiedWorksheet As Worksheet
Application.ScreenUpdating = False
' Set the source workbook (workbook with "ebay-orders" in its name)
Set sourceWorkbook = GetWorkbookWithMatchingName("ebay-Listings")
' Check if the source workbook was found
If Not sourceWorkbook Is Nothing Then
' Set the source worksheet (the only worksheet in the source workbook)
Set sourceWorksheet = sourceWorkbook.Worksheets(1)
' Set the target workbook (workbook named "Sales4")
Set targetWorkbook = ThisWorkbook ' Assuming this code is in the Sales4 workbook
' Copy the source worksheet to the target workbook
sourceWorksheet.Copy After:=targetWorkbook.Sheets(targetWorkbook.Sheets.Count)
' Set the copied worksheet object reference
Set copiedWorksheet = targetWorkbook.Sheets(targetWorkbook.Sheets.Count)
' Rename the copied worksheet to "ebay"
copiedWorksheet.Name = "ebay"
' Clean up
Set sourceWorksheet = Nothing
sourceWorkbook.Close False ' Close the source workbook without saving changes
Set sourceWorkbook = Nothing
'run code to add VLOOKUP formula
'If_string_match_found_place_formula
'run code to change neagative numbers to positive
'ChangeNegativeValues
Application.ScreenUpdating = True
Else
MsgBox "Source workbook not found."
End If
End Sub
Thanks in advance