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

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.

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
what formulas produce the error ?
 

pvzshark

Repeated rules violations
Joined
Feb 26, 2020
Messages
23
Office Version
  1. 2013
Platform
  1. Windows
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.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,526
Office Version
  1. 365
Platform
  1. Windows
Please supply ALL cross post links.
 

pvzshark

Repeated rules violations
Joined
Feb 26, 2020
Messages
23
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

There is none. Thanks you
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,526
Office Version
  1. 365
Platform
  1. Windows
Yes there is. Please supply ALL links, this not an option.
 

pvzshark

Repeated rules violations
Joined
Feb 26, 2020
Messages
23
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,526
Office Version
  1. 365
Platform
  1. Windows
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.
 

pvzshark

Repeated rules violations
Joined
Feb 26, 2020
Messages
23
Office Version
  1. 2013
Platform
  1. Windows
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.
https://www.reddit.com/r/excel/comments/g2dm8f as here al that happens is questions and insults but no answers. hopefulle reddit wil be more helpfull.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,485
Messages
5,636,608
Members
416,929
Latest member
Nitil

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
Top