Excel formatting everything lands in Column A

nobailjustjail

New Member
Joined
Nov 10, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I am copy/pasting data from my suppliers website (from the checkout cart page).

When pasting into Excel it all goes into Column A (and some unnecessary info into Column B too but that is easily deleted).

I need a fast way to get the data into the correct columns as I am doing this on a very big scale.

I have tried using the ''Find All'' function as this would help me to remove the rows I want deleted. But it doesn't allow me to go ahead and highlight them all and deleted them all in one go after I have found them all.

I have also tried using ''Text to columns'' but it does not pick up the ''$'' sign and recognise it as a break point. I think the $ used on the suppliers website is a different $ sign to the ones on Excel as they look visually different. In any case it doesn't recognise them as being the same thing. And even if it did, it would probably put the price and totals in one column as they both begin with a $ sign.

Even if it takes a little bit of mucking around I would like to get to the bottom of this because there surely has to be a faster way than posting thousands of entries one by one.

Thanks in advance.
 

Attachments

  • Excel Help 1.jpg
    Excel Help 1.jpg
    199.8 KB · Views: 20

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
If yes ^^ then you could maybe use the following macro and delete original columns A & B ?

VBA Code:
Sub ReHash()
Lastr = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False

r = 3
c = 0
For Each cell In Range("A1:A" & Lastr)
 If cell Like ("Product*") Then
 r = r + 1
 Range("C" & r) = cell
 End If
 
If IsNumeric(cell) Then
    c = c + 1
    Select Case c
        Case 1
            Range("D" & r) = cell
        Case 2
            Range("E" & r) = cell
        Case 3
            Range("F" & r) = cell
    End Select
    If c = 3 Then c = 0
    End If
Next cell

Application.ScreenUpdating = True

End Sub



Book1
ABCDEF
1
2
3
4Product 1234Product 1234$123.0012$32.00
5StuffJunkProduct 1239$123.0077$32.00
6More stuffProduct 1266$99.0022$54.00
7$123.00Product 1267$76.0023$31.00
812More junkProduct 1268$1.002$3.00
9$32.00
10Product 1239
11Stuff
12$123.00Rubbish
1377More junk
14$32.00
15Product 1266
16Stuff
17More stuffRubbish
18$99.00More junk
1922
20$54.00
21Product 1267
22More stuffRubbish
23$76.00More junk
2423
25$31.00
26Product 1268
27$1.00Rubbish
282More junk
29$3.00
30
Sheet1


Hope that helps
 
Upvote 0
Hi there. I am only using the One Drive (free version) of Excel. I don't have access to Macros (I don't think so anyway). And that seems almost like programming and I think it's outside of my skill level. I was hoping for something much simpler. Or is there no chance of a simple solution for such a formatting task?

They don't actually all say ''Product'' I just put that there to hide the products I resell. But they all start with the same word as I do my spreadsheets in groups by category.
 
Upvote 0
I am willing to buy the full version if required in order to learn Macros. I looked it up on YouTube and it seems to be a thing that basically records your keystrokes and repeats what it is that you do so that it essentially puts your labour into code so that it can be performed automatically. Does that sound right?

Do I need the paid version for it? Because it would definitely be worth it in the time I'd save...unless of course there's an easier way somehow
 
Upvote 0
You are correct that you will not be able to use macros unless you upgrade to a paid version.
Recorded macros can be of value but are always just literal recordings of every keystroke and move you make while recording. As such they generally produce very inefficient code that is specific to ranges used at the time they are recorded. A recorded macro can however be a good starting point for editing to form a more efficient / flexible macro. That does of course require vba programming knowledge. All good fun if you really have the need or fancy.

Maybe something like the below offers you a practical solution without the need for macros?

It could be done in situ or maybe you have it as a a template sheet.
Assumes all products in A will be identified by the same 'word' (category) as you will enter in cell I2
Single formulas in I4, J4, D4 will spill down
Formula in E4, drag across to G and down as far as needed. Ie depth of spill in D
Range D4:G?? should then hold your unstacked data which you can keep in place or copy to wherever you need.
With range D4:G?? selected do Copy > Paste Special > Values


Book1
ABCDEFGHIJ
1Category
2Cat-abc
3ProductPriceQtyTotalHelper!Helper2
4Cat-abc 5432Cat-abc 5432$24.0012$288.00Cat-abc 543224
5StuffJunkCat-abc 8736$10.0017$170.00Cat-abc 873612
6More stuffCat-abc 1266$4.5022$99.00Cat-abc 1266288
7$24.00Cat-abc 1556$6.0023$138.00Cat-abc 155610
812More junkCat-abc 1862$1.002$2.00Cat-abc 186217
9$288.00170
10Cat-abc 87364.5
11Stuff22
12$10.00Rubbish99
1317More junk6
14$170.0023
15Cat-abc 1266138
16Stuff1
17More stuffRubbish2
18$4.50More junk2
1922
20$99.00
21Cat-abc 1556
22More stuffRubbish
23$6.00More junk
2423
25$138.00
26Cat-abc 1862
27$1.00Rubbish
282More junk
29$2.00
Sheet1
Cell Formulas
RangeFormula
D4:D8D4=I4#
E4:G8E4=INDEX($J$4#,((ROWS($4:4)-1)*3)+COLUMNS($D:D),1)
I4:I8I4=FILTER(A4:A36,ISNUMBER(FIND(I2,A4:A36,1)),)
J4:J18J4=FILTER(A1:A36,ISNUMBER(A1:A36))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet1!$A$4:$A$38E4:G8, I4:J4


Hope that helps.
 
Upvote 0
Wow. You are a genius dude! Those formulas are uber complicated, and it took abit of tinkering around here to even understand what it was I was changing. But now I got it.

So I could reference a much longer sequence, I changed:

- D4 to I4:I10000

- I4 to =FILTER(A2:A10000,ISNUMBER(FIND(I2,A2:A10000,1)),)

- J4 to =FILTER(A1:A10000,ISNUMBER(A1:A10000))

With E4, as you say, just drag it across to G4 then go down as far as you need to.

I am saving this as a template as you have suggested. I am also bookmarking this page for future reference in case my formulas get messed up at some point. Obviously I have no chance of reproducing these formulas if I lose them. So I will just always use the template. The only limitation seems to be the word @ I2 (as it would need to be exactly the same across the range for it to be referenced). I imagine a multi dimensional one that incorporated a few different product names would be multitudes more complex?

I also did not understand the named ranges bit at the bottom of your post but it seems not to be critical to the template.

Named Ranges
NameRefers ToCells_FilterDatabase=Sheet1!$A$4:$A$38E4:G8, I4:J4

Thanks so much. I will definitely be back with many more Excel questions. I am somewhat of an amateur but I know just enough to tinker around and work it out if given abit of guidance.
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,944
Members
449,095
Latest member
nmaske

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