ClioSport.net

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Excel Help

Car  Tesla MP3 2021
Having a bit of a blonde day on Excel, I'm pretty sure I have done this before but I can't remember what I did!

Basically, if I have a list of numbers in 1 column (A) like below...

[TABLE="width: 84"]
[TR]
[TD="align: right"]123456789[/TD]
[/TR]
[TR]
[TD="align: right"]123456790[/TD]
[/TR]
[TR]
[TD="align: right"]123456791[/TD]
[/TR]
[TR]
[TD="align: right"]123456792[/TD]
[/TR]
[TR]
[TD="align: right"]123456793[/TD]
[/TR]
[TR]
[TD="align: right"]123456794[/TD]
[/TR]
[TR]
[TD="align: right"]123456795[/TD]
[/TR]
[TR]
[TD="align: right"]123456796[/TD]
[/TR]
[TR]
[TD="align: right"]123456797[/TD]
[/TR]
[TR]
[TD="align: right"]123456798[/TD]
[/TR]
[TR]
[TD="align: right"]123456799[/TD]
[/TR]
[TR]
[TD="align: right"]123456800[/TD]
[/TR]
[TR]
[TD="align: right"]123456801[/TD]
[/TR]
[TR]
[TD="align: right"]123456802[/TD]
[/TR]
[TR]
[TD="align: right"]123456803[/TD]
[/TR]
[TR]
[TD="align: right"]123456804[/TD]
[/TR]
[TR]
[TD="align: right"]123456805[/TD]
[/TR]
[TR]
[TD="align: right"]123456806[/TD]
[/TR]
[TR]
[TD="align: right"]123456807[/TD]
[/TR]
[TR]
[TD="align: right"]123456808[/TD]
[/TR]
[TR]
[TD="align: right"]123456809[/TD]
[/TR]
[/TABLE]

I need to copy that data and transpose into 1 cell but in a CSV format so it would look something like this (but with a space after the number,).....

[TABLE="width: 1344"]
[TR]
[TD="width: 64"]123456789,[/TD]
[TD="width: 64"]123456790,[/TD]
[TD="width: 64"]123456791,[/TD]
[TD="width: 64"]123456792,[/TD]
[TD="width: 64"]123456793,[/TD]
[TD="width: 64"]123456794,[/TD]
[TD="width: 64"]123456795,[/TD]
[TD="width: 64"]123456796,[/TD]
[TD="width: 64"]123456797,[/TD]
[TD="width: 64"]123456798,[/TD]
[TD="width: 64"]123456799,[/TD]
[TD="width: 64"]123456800,[/TD]
[TD="width: 64"]123456801,[/TD]
[TD="width: 64"]123456802,[/TD]
[TD="width: 64"]123456803,[/TD]
[TD="width: 64"]123456804,[/TD]
[TD="width: 64"]123456805,[/TD]
[TD="width: 64"]123456806,[/TD]
[TD="width: 64"]123456807,[/TD]
[TD="width: 64"]123456808,[/TD]
[TD="width: 64"]123456809[/TD]
[/TR]
[/TABLE]

Hope that makes sense!
 
Probably easier ways of doing it but I'd copy the list, paste into word (paste special, unformatted) then do a find (for paragraph marks, think it's ^p) and replace with , (comma space).

Then copy the lot and dump it back in the one cell.
 
You can f**k about doing it manually, however I would just use visual basic.

Alt + F11

Insert > New module

Paste this:

Code:
Sub Macro()
Dim rngTemp As Range
Set rngTemp = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("B1") = Join(WorksheetFunction.Transpose(rngTemp), ", ")
End Sub


Run it.

It will look at column A, then put all those values in cell B1.
 
Ooh Luke check you out! :)

That type of function will have you owning your own Twizy in no time...
 
LOL. I can read VBA but not too good at writing it. I mainly use google and save the useful stuff. I would never buy a twizy! :(
 
You can f**k about doing it manually, however I would just use visual basic.

Alt + F11

Insert > New module

Paste this:

Code:
Sub Macro()
Dim rngTemp As Range
Set rngTemp = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("B1") = Join(WorksheetFunction.Transpose(rngTemp), ", ")
End Sub


Run it.

It will look at column A, then put all those values in cell B1.

Boom... what a ledge :D

Cheers Luke

I need to learn this s**t!
 
Glad it worked :D

Save it to your personal.xls if you have to do that regularly. You can add a button to excel tool bar and run it on demand then.
 
Right click at the top of excel in a blank area. you'll get a long list of s**t, but click customize at the bottom.

Click toolbars > New > Give it a name "Adams toolbar"

Drag it to the top like you would any other toolbar.

Then cilck on commands, scroll to macro's and drag "Custom button" to your blank toolbar.

Right click the command smiley face you've just dragged, and you can assign macro.

Yuo can also change the icon to whatever you want. Picture below to help you. I have some vba I wrote to import my banking exports into a spreadsheet i use to track my finances so I have a simular set up with my Halifax button.

untitled.webp
 
If you want to learn some yourself you could add a couple of lines to that code which removes column A and saves the file as CSV to your desktop ;)
 
Back
Top