Deleting columns when specific cell value is not equal to named range

colts4u

New Member
Joined
Jan 18, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have data with values from thermocouple channels at certain times. The channels have names and are all in the same row and each has it's own column. The first column is the time and then each column thereafter are data for each channel. I've included an image of some of the data to help. I chart this data from selected channels I want to see. Because there is so much data, I delete what I don't want to chart. I have to do this manually and is very time consuming. I've made some VBA to help me create a chart with the data I want after I manually delete the columns I don't want. The data is in a CSV file, so I run my code once I've deleted the data I don't want. Could someone help me with VBA that could delete that columns of data I do not want automatically? So far, I have created named ranges. For example, "_pos1" refers to a range of cells, 4 cells with a channel name in each cell. The plan was to have a checkboxes on a form that would refer to each named range. If you selected "checkbox1", the code would delete all the other columns and just leave the columns that equaled the named range of channels. I've done some searching, but haven't been able to put some code together to make this work. Any ideas?
 

Attachments

  • TCworksheet.jpg
    TCworksheet.jpg
    125.3 KB · Views: 8

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,491
Messages
6,125,111
Members
449,205
Latest member
ralemanygarcia

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