Hide columns with errors?

pvzshark

Repeated rules violations
Joined
Feb 26, 2020
Messages
23
Office Version
  1. 2013
Platform
  1. Windows
I have also posted it on excelforum: Hide columns with errors?

Good day.

I have been helped to continue if subscript out of range error appears which is working 100%

My next question is how do I now hide the culumn if it has a error on it?
So i am importing data, but the number of rows keep changing, I have done some coding on them but when they are not imported i get errors because they dont exist, that is
why i added "On Error Resume Next" , so my next logical step will be to hide all of them that has no data pulled in,
Cannot delete them as i have columns at end that sums to the right that include them, so i just need to hide the columns.

Regards

File-Copy-icon.png

VBA Code:
On Error Resume Next
ActiveSheet.ListObjects("Table_pastel_12_cust_rank").ListColumns(47). _
TotalsCalculation = xlTotalsCalculationSum
On Error Resume Next
ActiveSheet.ListObjects("Table_pastel_12_cust_rank").ListColumns(48). _
TotalsCalculation = xlTotalsCalculationSum
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
what formulas produce the error ?
 
Upvote 0
what formulas produce the error ?
ActiveSheet.ListObjects("Table_pastel_12_cust_rank").ListColumns(47). _
TotalsCalculation = xlTotalsCalculationSum
because column 47 has no data - so i want to hide it.
 
Upvote 0
Please supply ALL cross post links.
 
Upvote 0
Yes there is. Please supply ALL links, this not an option.
 
Upvote 0
well the one is one top, there is no other one. where are you getting your info?

is this because i am a springbok rugby supporter? lol
 
Upvote 0
Please do not lie to me, you have posted this question on more than one other site & have not supplied all the links. Where that information came from is irrelevant.
It is quite simple. Either you obey the rules of this site, or you are likely to have your posting privileges revoked. Your choice.
 
Upvote 0
ffs - i am not lying. the one in orzid or something is totally different ok. and right now withing the las minute i have posted it on reddit.
as here al that happens is questions and insults but no answers. hopefulle reddit wil be more helpfull.
 
Upvote 0

Forum statistics

Threads
1,213,553
Messages
6,114,279
Members
448,562
Latest member
Flashbond

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