Split and Find or Left and Find?

Status
Not open for further replies.

p9326

New Member
Joined
Aug 19, 2022
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
I have a 2 worksheet 1 is for data base with 3 command buttons, 1 sheet for barcode scanner data transferring to excel with date and time stamp are included.

Could someone could help me to split or left and find functions to remove the date and time stamps on A2 and B2 Column when I click my consolidated button.

Here is the code in consolidated button.

Split.jpg


VBA Code:
Sub Sample()
    Dim ws As Worksheet
    Dim wsCon As Worksheet
    Dim lr As Long: lr = 2
    Dim wsLR As Long
   
    '~~> This is your Consolidated worksheet
    Set wsCon = ThisWorkbook.Sheets("Consolidated")
    wsCon.AutoFilterMode = False
   
    '~~> Clear the contents for input
    wsCon.Range("A2:C" & wsCon.Rows.Count).ClearContents
   
    '~~> Copy the data in to the Consolidated worksheet from other sheets
    For Each ws In ThisWorkbook.Worksheets
        If ws.Name <> wsCon.Name Then
            wsLR = ws.Range("A" & ws.Rows.Count).End(xlUp).Row
           
            ws.Range("A2:C" & wsLR).Copy wsCon.Range("A" & lr)
           
            lr = wsCon.Range("A" & wsCon.Rows.Count).End(xlUp).Row + 1
        End If
    Next ws
   
    With wsCon
        '~~> Remove duplicates
        .Range("A1:C" & lr).RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlYes
        '~~> Apply filter in row 1
        .Range("A1:C1").AutoFilter
    End With
End Sub




I attached the Picture for much
 
Last edited by a moderator:
@Anthony47 sir, could you help me once again. Instead of making a user form, I will add new command button that shows only the items not been out in the system. , assuming the last green item is not being out when I press the new command button all the items gone and the only IN item will show so I can tell how many are still on my inventory, thank you in advance.
IN.jpg
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Sorry, but I shall not be able to work on your request auntil this evening (ie 11 hours from now).
If in the meantime you don't receive acknowledges please try to clarify the request, because you are using terms more related to what you do than what you show.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top