Create Pop Up Table

young engineer

Board Regular
Joined
Mar 3, 2009
Messages
100
Hi All
I want to create a sort of pop up table of results from my worksheet, and link it to a button. I want to have the following columns side by side for comparison purposes: F:V, I:U, M:Z, Q:AH, AD:Al. I also want to have columns F,I,M,Q,AD a certain colour, and columns V,U,Z,AH,AL a certain colour.

Any help on how I write the code code for this and link it to a toggle button to show/hide this table. I am using excel 2007.
Please Help
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hello,

is this working as expected?

Code:
Sub CREATE_TABLE()
    Sheets("Sheet2").Cells.ClearContents
    With Sheets("Sheet1")
        .Columns("F:V").Copy Sheets("Sheet2").Range("IV1").End(xlToLeft).Offset(0, 1)
        .Columns("I:U").Copy Sheets("Sheet2").Range("IV1").End(xlToLeft).Offset(0, 1)
        .Columns("M:Z").Copy Sheets("Sheet2").Range("IV1").End(xlToLeft).Offset(0, 1)
        .Columns("Q:AH").Copy Sheets("Sheet2").Range("IV1").End(xlToLeft).Offset(0, 1)
        .Columns("AD:AL").Copy Sheets("Sheet2").Range("IV1").End(xlToLeft).Offset(0, 1)
    End With
    With Sheets("Sheet2")
        .Visible = True
        .Columns("A").Delete
        .Columns("Q").Interior.ColorIndex = 3
        .Columns("AD").Interior.ColorIndex = 3
        .Columns("AR").Interior.ColorIndex = 3
        .Columns("BJ").Interior.ColorIndex = 3
        .Columns("BS").Interior.ColorIndex = 3
   End With
End Sub

change sheet names as required.
 
Upvote 0
The code seems right, and i have changed the sheet names, but should i put this code into my macro, or link it to a button. If I have to link it, how do I go about doing so. I am using excel 2007
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

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