Flexible data columns

LisaGreen
5StarLounger
Posts: 904
Joined: 08 Nov 2012, 17:54

Flexible data columns

Post by LisaGreen »

Hi,

This is a technique methodology question.

If I had a row of data with say 10 columns of data, what might be a way of altering the order of the columns along with the relevant data items. Ideally I'd like to define a string..
"Length/Type/Duration/Start Time/Name/Date/Channel/Index Number/Author"
.. say, and be able to change the order the data is presented in in the headings and columns by altering just the string.

Any suggestions and thoughts appreciated..
TIA
Lisa

BobH
UraniumLounger
Posts: 8420
Joined: 13 Feb 2010, 01:27
Location: Temple - Deep in the Heart of Texas

Re: Flexible data columns

Post by BobH »

There is probably an obvious answer, but why not just sort the columns instead of the rows?
Bob's yer Uncle!
(1/2)(1+√5)
Intel Core i5, 3570K, 3.40 GHz, 16 GB RAM, ECS Z77 H2-A3 Mobo, Windows 7 >HPE 64-bit, MS Office 2016

User avatar
HansV
Administrator
Posts: 72885
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Flexible data columns

Post by HansV »

Would you have the string in a cell, and have Excel change the column order automatically when the cell is edited?
If not, how would it work?
Regards,
Hans

LisaGreen
5StarLounger
Posts: 904
Joined: 08 Nov 2012, 17:54

Re: Flexible data columns

Post by LisaGreen »

> How would that work

You're right. There has to be a link between what the data represents and where it's put on the sheet. Ie.. The columns in the data must be named somehow. It's a kludge but maybe I'll go with the first row.

OTOH perhaps I'll try and use SQL in excel and ORDINAL though I think there still needs to be some connection. hmmmmm.

Will have a lookie.

Thanks for prompting me Hans.

LIsa

p45cal
StarLounger
Posts: 78
Joined: 11 Jun 2012, 20:37

Re: Flexible data columns

Post by p45cal »

Lisa, try changing the string in cell E1 of the attached and observe the table below.
You do not have the required permissions to view the files attached to this post.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 12799
Joined: 24 Jan 2010, 23:23
Location: pedantic.obstreperous.reprobate

Re: Flexible data columns

Post by ChrisGreaves »

LisaGreen wrote:
15 Nov 2021, 00:12
This is a technique methodology question.
Hi Lisa. Notwithstanding the immediately practical suggestions above, I think that you are thinking of a "Data Descriptor" for which the web has several indexed pages. You might afterwards narrow your search to "VBA Data Descriptor" . That ought to bring you around to the VBA TYPE/END TYPE statement for ideas.
Some people call this "dealing with meta-data, which I suppose it is, but your idea of "Length/Type/Duration/Start Time/Name/Date/Channel/Index Number/Author" seems to be defining some data which (definition) is itself data to be manipulated.

Closer to home: when I call a VBA procedure passing the parameters ByRef[erence}, I think of those parameters as data descriptors.
Cheers
Chris
Congratulations on completing another lap around The Sun