Excel to close trailing window

Hi I use a code to copy paste from a one drive excel sheet to another This is my code to open the file: Public openwb As Workbook Sub testOpenWBOneDrive() Dim wbFullName, objLogExcel As Object Set objLogExcel = CreateObject("Excel.Application") objLogExcel.Visible = True wbFullName = "https://mysmartplace-my.sharepoint.com/personal/Misc/data.xlsx" Set openwb = objLogExcel.Workbooks.Open(wbFullName) End Sub And my code to… Read More Excel to close trailing window

Why won't this VBA code write or update records to a new tab?

Here is the code: Private Sub Query1_Change(ByVal Target As Range) Dim myRange As Range Dim myCell As Range Dim wsComments As Worksheet Dim wsQuery1 As Worksheet Dim lastRow As Long Dim i As Long Dim foundMatch As Boolean Set wsComments = ThisWorkbook.Sheets("Comments") Set wsQuery1 = ThisWorkbook.Sheets("Query1") If Target.Row < 2 Or (Target.Column <> 31 Or… Read More Why won't this VBA code write or update records to a new tab?

avoid #NV values with excel vba

I have written this piece of code: thisworkbook.Sheets("test_destination").Range("J2:K" & lastrow_orgid).Value = Application.WorksheetFunction.Unique(diesesworkbook.Sheets("test_source").Range("J2:K" & lastrow_orgid).Value) It does what it is supposed to do but it creates these #NV values. Maybe someone could tell me if there is another way to write this to avoid these #NV values. >Solution : Couple of things. Work with objects. This… Read More avoid #NV values with excel vba