Simple way to re-write VBA code?

spydey

Active Member
Joined
Sep 19, 2017
Messages
314
Office Version
  1. 2013
Platform
  1. Windows
So I have some code that I have written referencing arrays, named ranges, and ranges.

I have taken the workbook and re-designed it to be table based.

I figure I will have to re-write the VBA code to reference the table objects instead of the ranges, right?

Is there a simple way to do this or am I going to have to go line by line and re-write it to properly reference the table objects in place of the ranges/named ranges/arrays?

Thanks for your help!

-Spydey
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
You can still reference simple ranges in an Excel Table. Named ranges work also. When you say you're referencing arrays, do you mean arrays in VBA?

Jeff
 
Upvote 0
You can still reference simple ranges in an Excel Table. Named ranges work also. When you say you're referencing arrays, do you mean arrays in VBA?

Jeff

Yes, I figured I could still reference the same ranges and named ranges, but when I redesigned the workbook to be table based, I renamed my ranges, etc.

As far as the arrays, yes they are coded in VBA.

I think I am going to have to re-write the majority of it.

Good practice for me .... just didn't want to have to re-do what took me ages ... hahaha, but I am just learning so maybe this will be a good thing.

Thanks for your input.

-Spydey
 
Upvote 0
hahaha, but I am just learning so maybe this will be a good thing.
Is is a good thing -- the code will be better, more organized, easier to understand.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,108
Members
452,302
Latest member
TaMere

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