Needing Macros made to copy data from two sheets to one and sorted

khelp11

New Member
Joined
Mar 13, 2024
Messages
11
Office Version
  1. 2011
Platform
  1. Windows
I am needing two different things for this,

1. I am needing to be able to enter either a bid number or bid name and have it automatically fill in the other information from the bidders sheet for each live and silent auction sheets.

2. Needing all lines from silent and live auction sheets to copy and pull over to the check out sheet and sort by bidder number.

Auction Platform 1.xlsm
ABCDE
1Item #Item DescriptionBidder #BuyerWinning Bid
21earrings1
33cowboy art4
44car6
58t-shirt8
69tanktop4
710shoes11
811blue board5
916rug7
1018elk hunt20
1120phone18
1242lamp4
Silent


Auction Platform 1.xlsm
ABCDE
1Item #Item DescriptionBidder #BuyerWinning Bid
22necklace9
35chair 8
46frame4
57board6
612pink frame14
713dresser1
814elk horn5
915deer mount7
1017buffalo hide8
1119buffalo hunt15
1221sign13
Live


Auction Platform 1.xlsm
ABC
1Bid NumberNamePhone Number
21joey(287) 201-8233
32cody(111) 115-5533
43krys(345) 666-9999
54sid(199) 999-9983
65di(209) 129-3841
76jame(111) 111-1111
87aie(333) 333-3333
98aaaa(228) 486-6047
109kjsdfie(228) 552-6058
1110ksdjfi(228) 618-6069
1211lsdoi(228) 684-6079
1312ksjdfi(228) 750-6090
1413stu(228) 816-6101
1514bo(228) 882-6111
1615toe(228) 948-6122
1716moe wkj(229) 014-6132
1817eeed(229) 080-6143
1918asd(229) 146-6154
2019sdkji(229) 212-6164
2120kjsdi(229) 278-6175
Bidders



Auction Platform 1.xlsm
ABCDEFG
1Item #Item DescriptionBuyerBidder #Winning BidAmount PAIDpayment type
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Check out
Cells with Data Validation
CellAllowCriteria
G1:G22List=$L$3:$L$5
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try below code ...
VBA Code:
Sub test()

Dim Txt$, Col&
Txt = InputBox("Please enter specific bid # or bid name or ALL")

If Len(Txt) = 0 Then
    MsgBox "No bidder data was entered, macro will be stopped", vbExclamation
    Exit Sub
End If

Sheets("Check out").[A1].CurrentRegion.Offset(1).Clear
Col = IIf(Val(Txt), 1, 2)

For Each e In Array("Silent", "Live")
    With Sheets(e).[A1].CurrentRegion
        If UCase(Txt) = "ALL" Then
            .Offset(1).Copy Sheets("Check out").Range("A" & Rows.Count).End(3)(2)
        Else
            .AutoFilter Col, Txt
            .Offset(1).Copy Sheets("Check out").Range("A" & Rows.Count).End(3)(2)
            .AutoFilter
        End If
    End With
Next

If UCase(Txt) = "ALL" Then Sheets("Check out").[A1].CurrentRegion.Sort [A1], 1, Header:=xlYes

End Sub
 
Upvote 1
Solution
It did not work but it said error 1004 something about sort by.
 
Upvote 0
If the error is only related to sorting then it should completed all the code lines without error to transfer the data & the error is only related to sorting, can you confirm ?
 
Upvote 0
So, I went to run the macro "test". then it comes up with the box below.

1713315096979.png


If I enter ALL then it comes up with he following box

1713315167404.png


I do not need or know what the box saying "Please enter specific bid # or name or ALL". I am only wanting to be able to enter either a bid number or bid name in the silent and live auction tabs and have the other information from the bidders sheet automatically fill in.

Then, I want all the rows in the silent and live auction information automatically pulled over to the check out sheet and then sort them by the bidder number.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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