any help would be greatly appreciated. Im a newbe !!

cassist

New Member
Joined
Nov 22, 2012
Messages
3
I have a worksheet containing 6,000+ item from my hardware store. I want to create barcode labels for item numbers keyed in. The flow would be..... 1. key in an item number via (input box) 2. macro to find that item number in column of sheet <1> and copy the row to sheet <2>. Then back to sheet to get another item number or <done>. It sounds simple and I have looked at other code online but still can't get it to work. It needs to loop <ask item="" number=""><copy to="" sheet2=""><ask item="" number="">. when <done> is selected then sheet2 will have all those items. Thanks in advance for any help you can give.</done></ask></copy></ask></done>
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I have a worksheet containing 6,000+ item from my hardware store. I want to create barcode labels for item numbers keyed in. The flow would be..... 1. key in an item number via (input box) 2. macro to find that item number in column of sheet <1> and copy the row to sheet <2>. Then back to sheet to get another item number or <DONE>. It sounds simple and I have looked at other code online but still can't get it to work. It needs to loop <ASK number="" item=""><COPY sheet2="" to=""><ASK number="" item="">. when <DONE>is selected then sheet2 will have all those items. Thanks in advance for any help you can give.</DONE></ASK></COPY></ASK></DONE>

Hi & welcome to the board.
Are you trying to develop an Electronic Point Of Sale (EPOS) system? If so,
have a read here http://www.mrexcel.com/forum/excel-...uy-deals-excel-visual-basic-applications.html
Further down you will find a link where you can download a opensource copy of an Excel Based EPOS system. May save you a lot of trouble. If not what you are looking for, post back & sure someone will offer assistance.

Dave
 
Upvote 0
Hi & welcome to the board.
Are you trying to develop an Electronic Point Of Sale (EPOS) system? If so,
have a read here http://www.mrexcel.com/forum/excel-...uy-deals-excel-visual-basic-applications.html
Further down you will find a link where you can download a opensource copy of an Excel Based EPOS system. May save you a lot of trouble. If not what you are looking for, post back & sure someone will offer assistance.

Dave
Hi Dave, first off thanks for getting back with me. No the pos is working ok. this is a "outside the box" project. I will export the entire inventory file out of quickbooks pos in a excel file. I then want to open that file and have the user enter a list of item numbers. the macro will then find the item number, copy the row to "sheet2" and go back to sheet1 to get another item number. If the user enters <done> or something like then I want sheet2 saved and that is all. Im using Wasp for the label printing software and it is fine. I just need a macro on the excel side that can be opened by a [button] and run. This will generate the item list of barcode labels needing printed.
 
Upvote 0
As a something to start with - see if this goes in right direction for you. Save code to standard module.

Code:
Sub SearchBarcode()
    Dim ws1 As Worksheet
    Dim ws2 As Worksheet
    Dim FoundCell As Range
    Dim rng As Range
    Dim rng2 As Range
    Dim sTitle As String
    Dim sPrompt As String
    Dim msg

    Set ws1 = Sheets("Sheet1")    '<your master data
    Set ws2 = Sheets("Sheet2")  '<copy data
    sTitle = "Search Barcode Number"
    sPrompt = "Enter Barcode Number"
startsearch:
    'Type 1 = Number
    'Type 2 = Text (string)
    Search = Application.InputBox(prompt:=sPrompt, Title:=sTitle, Type:=1)
    If Search <> 0 Then
        Set FoundCell = ws1.Columns("A").Find _
                        (Search, LookIn:=xlValues, _
                         LookAt:=xlWhole)
        If Not FoundCell Is Nothing Then
            Set rng = FoundCell.EntireRow
            Set rng2 = ws2.Range("A" & ws2.Cells(ws2.Rows.Count, "A").End(xlUp).Row + 1)
            rng.Copy rng2
            msg = MsgBox("Barcode: " & Search & Chr(10) & _
                         "Record Added - Do You Want To Enter Another BarCode?", 36, sTitle)
            If msg = 6 Then GoTo startsearch

        Else
            msg = MsgBox("Barcode: " & Search & Chr(10) & _
                         "Record Not Found", vbInformation, sTitle)
            GoTo startsearch
        End If
    End If
End Sub

Dave
 
Upvote 0
something strange going on with board - re-post code without tags

Sub SearchBarcode()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim FoundCell As Range
Dim rng As Range
Dim rng2 As Range
Dim sTitle As String
Dim sPrompt As String
Dim Search As String
Dim msg

Set ws1 = Sheets("Sheet1") '<YOUR master data

Set ws2 = Sheets("Sheet2") '<COPY data


sTitle = "Search Barcode Number"
sPrompt = "Enter Barcode Number"
startsearch:
'Type 1 = Number
'Type 2 = Text (string)
Search = Application.InputBox(prompt:=sPrompt, Title:=sTitle, Type:=1)
If Search <> 0 Then
Set FoundCell = ws1.Columns("A").Find _
(Search, LookIn:=xlValues, _
LookAt:=xlWhole)
If Not FoundCell Is Nothing Then
Set rng = FoundCell.EntireRow
Set rng2 = ws2.Range("A" & ws2.Cells(ws2.Rows.Count, "A").End(xlUp).Row + 1)
rng.Copy rng2
msg = MsgBox("Barcode: " & Search & Chr(10) & _
"Record Added - Do You Want To Enter Another BarCode?", 36, sTitle)
If msg = 6 Then GoTo startsearch

Else
msg = MsgBox("Barcode: " & Search & Chr(10) & _
"Record Not Found", vbInformation, sTitle)
GoTo startsearch
End If
End If
End Sub
 
Last edited:
Upvote 0
Morning Dave,
The first post had errors in the code. However I loaded the 2nd post and it worked just fine. I thank you for your help
 
Upvote 0
Morning Dave,
The first post had errors in the code. However I loaded the 2nd post and it worked just fine. I thank you for your help

Hi,
first post would not load to site for some strange reason & was incomplete.
Glad what I sent second time was of some help to you.

Thanks for feedback

Dave
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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