Excel macro won't change or delete header text

knees21

New Member
Joined
Aug 27, 2019
Messages
1
Hi. I'm new to macros/VBA in Excel and have been working through recording some print macros with a good deal of success....until I hit this infuriating roadblock. And it's something that seems like it should be so simple! :confused:

As a final step after auto filtering and formatting my large data set, I just want to change the text in the top left Header cell to reflect the name of the list I'm printing. The name changes depending upon filters and sorts applied (e.g. Retail Stocklist (A-Z), Sale Items (categorised)....). I can get the Header to change once (the first time, assuming I start with a blank Header cell) but after that, no matter what I've tried, how many videos I watch and how much I've Googled, I just cannot manage to delete and/or change the list name/text in the top left Header cell. It's driving me bonkers.

I've tried recording the macros in every order possible (starting blank, starting with text and deleting, header change first, header change last etc etc....), I've tried inserting dummy text (thinking maybe having no text is the issue), I've tried tinkering with the code (my attempt at creating and then referencing a List Name cell value based on filters applied was a spectacular failure), but I just can't seem to solve this problem.

It feels like I'm now well and truly over-complicating what should be a simple task.

If anyone is able to point a Header macro novice in the right direction please I would be incredibly grateful :)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hello,

Can you post your code please. I seem to be able to change it, but don't know how you are trying to do it.
.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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