Results 1 to 12 of 12

Delete the same specific row in two worksheets

Threaded View

  1. #1
    Registered User
    Join Date
    08-28-2020
    Location
    US
    MS-Off Ver
    2016
    Posts
    16

    Delete the same specific row in two worksheets

    Hi,

    I am trying to create a macro that will be able to select a UPC code from the "Daily Usage" Sheet and correspond it to the same UPC code from the "Total Data" Sheet and delete them both and move them both up (no blank spaces). Here is what I have so far. I tried to correspond it by trying to compare the Time Value, but I found out that the time value will be off by 1 second sometimes because it takes a little time for it to be scanned on "Daily Usage" and copied/pasted to the "Total Data" (I created a macro for that already)

    Sub Delete()
        Dim xScreenUpdating As Boolean
        Dim DailyUsedUPC As Range
        Dim UsedUPC As Range
        Dim xTxt As String
        
        On Error Resume Next
        xTxt = ActiveWindow.RangeSelection.Address
        Set DailyUsedUPC = Application.InputBox("Select UPC code to delete", "Delete UPC", xTxt, , , , , 8)
        
        If DailyUsedUPC Is Nothing Then
        MsgBox "Canceled"
    
        
        DailyUsedUPC.Delete Shift:=xlUp
        Sheets("Used").Select
    
        
      End If
        Application.ScreenUpdating = xScreenUpdating
    
        
    End Sub
    Edit: I also forgot to mention that I don't want it to be cell referenced directly because the "Daily Usage" Sheet will be cleared every day while the "Total Data" sheet won't be. I just want to have the option to delete a UPC code from both sheets in case a worker accidentally scans something twice.
    Attached Files Attached Files
    Last edited by Cygneous; 09-10-2020 at 11:20 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to delete Worksheets that don't contain a specific pattern
    By Brawnystaff in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-08-2020, 03:44 PM
  2. VBA to delete worksheets except one specific sheet
    By winmaxservices in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2015, 08:15 AM
  3. [SOLVED] Delete all blanks rows in specific range on all worksheets
    By Dumy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-01-2015, 03:06 PM
  4. VBA loop to insert and delete worksheets in a specific sheet within a list
    By supppy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2014, 09:02 PM
  5. [SOLVED] Delete specific row for all worksheets
    By lorena ferraz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2014, 10:44 AM
  6. How to delete entire row if first cell of it is empty for specific range and worksheets
    By roshanvmech in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2014, 12:36 PM
  7. [SOLVED] Macro to delete all worksheets except for one with specific name
    By jaimealvarez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2012, 12:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1