gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
Can you please modify this event so that the values found in B18:B21 where the Offset(0,…
- User
Can you please modify this event so that the values found in B18:B21 where the Offset(0, 1).value = x are pasted to the next available cell after B24
Sub CopyXtraWorkB() Dim wbkx As Workbook Dim wsx As Worksheet Dim wsToday As Worksheet Dim wsxr As Range Dim x As Range Dim lastRow As Long
Set wbkx = ThisWorkbook Set wsx = wbkx.Worksheets("Today") Set wsToday = wbkx.Worksheets("Today") Set wsxr = wsx.Range("B18:B21") Application.EnableEvents = False Application.ScreenUpdating = False lastRow = wsToday.Cells(wsToday.Rows.Count, "B").End(xlUp).Row For Each x In wsxr If x.Offset(0, 1).Value <> "x" Then lastRow = lastRow + 1 wsToday.Cells(lastRow, "B").Value = "x" End If Next x Application.ScreenUpdating = True Application.EnableEvents = TrueEnd Sub
- Assistant
Sub CopyXtraWorkB() Dim wbkx As Workbook Dim wsx As Worksheet Dim wsToday As Worksheet Dim wsxr As Range Dim x As Range Dim lastRow As Long Dim nextRow As Long
Set wbkx = ThisWorkbook Set wsx = wbkx.Worksheets("Today") Set wsToday = wbkx.Worksheets("Today") Set wsxr = wsx.Range("B18:B21") Application.EnableEvents = False Application.ScreenUpdating = False lastRow = wsToday.Cells(wsToday.Rows.Count, "B").End(xlUp).Row nextRow = lastRow + 1 For Each x In wsxr If x.Offset(0, 1).Value = "x" Then wsToday.Cells(nextRow, "B").Value = x.Value nextRow = nextRow + 1 End If Next x Application.ScreenUpdating = True Application.EnableEvents = TrueEnd Sub