Quick way to change hard coded cells in VBA

adam_ng

New Member
Joined
Jan 27, 2022
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

Is there a quick way to change/develop a macro to change the hardcoded cell references A, B, B1 (for example to A -> B, B -> C, B1 -> C1)? The reason is these hardcoded cell references are pretty much across a lot of modules and i need to develop a quick way to change the hardcoded references.


'C&P sum of column into the identified column
ActiveCell.EntireColumn.Copy
Sheets("Tab One").Columns("A:A").Select
ActiveSheet.Paste
Application.CutCopyMode = False

'Index match codes for the identified tab
Sheets("Tab One").Cells(1, "B").Formula = "=INDEX('Tab Two'!F:F,MATCH('Tab1'!A1,'Tab Two'!E:E,0))"
Sheets("Tab One").Range("B1:B" & lastrow1).FillDown
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Depending on the situation, you may be able to use Find and Replace in the VBE to achieve that, but it could be tricky,

i could for example replace all "B1:B" with "C1:C", that should be easy, but if i have some random Bs and Cs, the find and replace may do more than it is expected to,

But that is a starting point
 
Upvote 0
Depending on the situation, you may be able to use Find and Replace in the VBE to achieve that, but it could be tricky,

i could for example replace all "B1:B" with "C1:C", that should be easy, but if i have some random Bs and Cs, the find and replace may do more than it is expected to,

But that is a starting point
Thanks but is there a routine that I may come up to do this?
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,986
Members
448,538
Latest member
alex78

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