Subscript out of range

pvzshark

Repeated rules violations
Joined
Feb 26, 2020
Messages
23
Office Version
  1. 2013
Platform
  1. Windows
Good day all. I am getting an error subscript out of range. I know why i am getting it, I just need your help to bypass it.

I am importing data from mysql. Financial year vs last year financial year. but being in April the may, June July etc months does not exist for this year so i need to ignore it.
Below is wehre i do calculations for the columns 40 and 41. but they do not exist with this import but might for a future import. How do i if exist then else ignore?

VBA Code:
ActiveSheet.ListObjects("Table_pastel_12_cust_rank").ListColumns(40). _
TotalsCalculation = xlTotalsCalculationSum

ActiveSheet.ListObjects("Table_pastel_12_cust_rank").ListColumns(41). _
TotalsCalculation = xlTotalsCalculationSum
 
Wel no I get it, geesh ffs. so when post on another forum just add link from this one. easy as pie. now fluff, do you know vba?
 
Last edited by a moderator:
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I would strongly suggest you take the time to read the rules of this, as you obviously haven't bothered to do so yet. This includes insulting other people.
 
Upvote 0
Again fluff. Do you know vba at all? will you be able to help here, or are you just gonna fill this post with bad remarks? if you do know vba please help. how do I
in stead of just resume next, hide the column as well? If you do not know how to answer let me know and I will stop asking you. Maybee get someone who might be able to answer?

VBA Code:
On Error Resume Next
ActiveSheet.ListObjects("Table_pastel_12_cust_rank").ListColumns(35). _
TotalsCalculation = xlTotalsCalculationSum
On Error Resume Next
ActiveSheet.ListObjects("Table_pastel_12_cust_rank").ListColumns(36). _
TotalsCalculation = xlTotalsCalculationSum
On Error Resume Next
 
Upvote 0
Fluff just does not like me because the springboks took the world cup. lol. Sorry I had to. lol
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,424
Members
448,896
Latest member
MadMarty

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