ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Column changing (https://www.excelbanter.com/excel-worksheet-functions/167962-column-changing.html)

sby

Column changing
 
Hi

This is a big ask but does anyone know how to data in one column to show
different data.
What I want is to have a column with data and at the bottom have a button
which when you press it changes the data to something different (ie: a hidden
column) and when you click it again it put the original data back.
I want this so I do not have to have more columns on a sheet.

Thanks

SBY

Roger Govier[_3_]

Column changing
 
Hi

Take a look at the Group and Outline function.
Mark any number of columns that you wish DataGroup and OutlineGroup
Thos columns will now be hidden, and you will see a "+" sign inserted above
the column headers.
Clicking the + sign will make them visible again, and the sign will change
to -. Clicking the - sign will hide them again.

--

Regards
Roger Govier

"sby" wrote in message
...
Hi

This is a big ask but does anyone know how to data in one column to show
different data.
What I want is to have a column with data and at the bottom have a button
which when you press it changes the data to something different (ie: a
hidden
column) and when you click it again it put the original data back.
I want this so I do not have to have more columns on a sheet.

Thanks

SBY



sby

Column changing
 
Thanks Roger

That works, but what I would like is for only one sheet to appear at a time.
I was thinking about using a button (spin or toggle). any ideas.

Regards


SBY

"Roger Govier" wrote:

Hi

Take a look at the Group and Outline function.
Mark any number of columns that you wish DataGroup and OutlineGroup
Thos columns will now be hidden, and you will see a "+" sign inserted above
the column headers.
Clicking the + sign will make them visible again, and the sign will change
to -. Clicking the - sign will hide them again.

--

Regards
Roger Govier

"sby" wrote in message
...
Hi

This is a big ask but does anyone know how to data in one column to show
different data.
What I want is to have a column with data and at the bottom have a button
which when you press it changes the data to something different (ie: a
hidden
column) and when you click it again it put the original data back.
I want this so I do not have to have more columns on a sheet.

Thanks

SBY




FSt1

Column changing
 
hi,
try this. it will hide one column while showing another and change the
button color and captions.
Private Sub CommandButton1_Click()
If Columns("C:C").Hidden = True Then
Columns("C:C").Hidden = False
CB1.BackColor = RGB(0, 0, 255)
'CB1.ForeColor =
CB1.Caption = "Numbers"
Columns("D:D").Hidden = True
Else
Columns("C:C").Hidden = True
Columns("D:D").Hidden = False
CB1.BackColor = RGB(245, 30, 5)
'CB1.ForeColor =
CB1.Caption = "Letters"
End If
End Sub

edit to fit your data.
regards
FSt1
"sby" wrote:

Thanks Roger

That works, but what I would like is for only one sheet to appear at a time.
I was thinking about using a button (spin or toggle). any ideas.

Regards


SBY

"Roger Govier" wrote:

Hi

Take a look at the Group and Outline function.
Mark any number of columns that you wish DataGroup and OutlineGroup
Thos columns will now be hidden, and you will see a "+" sign inserted above
the column headers.
Clicking the + sign will make them visible again, and the sign will change
to -. Clicking the - sign will hide them again.

--

Regards
Roger Govier

"sby" wrote in message
...
Hi

This is a big ask but does anyone know how to data in one column to show
different data.
What I want is to have a column with data and at the bottom have a button
which when you press it changes the data to something different (ie: a
hidden
column) and when you click it again it put the original data back.
I want this so I do not have to have more columns on a sheet.

Thanks

SBY





All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com