Forum

Find what causes vb...
 
Notifications
Clear all

Find what causes vba to trigger

7 Posts
3 Users
0 Reactions
131 Views
(@lanser)
Posts: 61
Estimable Member
Topic starter
 

Hi,

I have a speadsheet that I made a few years ago and now going to use for a different client however when I try to change a cell to reference another (i.e. in cell E10 type =E1) instead of getting the date returned that is in E1 I get "Jan2" and the formula disappears.

I have checked vba for any subs I might have put in that fire from worksheet change events  but can't see anything that would do that

 

Is there anyway I can see what subs are being triggered and whats triggering them?

 

regards

John

 
Posted : 10/07/2020 8:56 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi John,

Please provide your workbook when asking a qs like this.  I can't look at the code modules or the sheet contents to answer you properly.

Maybe E10 is formatted to just display jan2?  I don't know what date is in E1.

Regards

Phil

 
Posted : 10/07/2020 9:05 am
(@debaser)
Posts: 836
Member Moderator
 

Do you have any workbooks loaded that have userforms with controls linked directly to cells (using controlsource property)? That could cause exactly what you describe without any code running.

 
Posted : 11/07/2020 4:57 am
(@lanser)
Posts: 61
Estimable Member
Topic starter
 

Hi Phil,

I thought there might be a watch window or something I could set to trace dependants etc. 

Its just formatted to "mmm"

@velouria I just opened it alone and it still does the same.

 

I have added the spreadsheet its Schedule 2020 sheet any passwords have been set to "" or "password"

 
Posted : 14/07/2020 4:30 am
(@debaser)
Posts: 836
Member Moderator
 

Row 10 is the top row of your table, and you can't use formulas in header cells, which is why they are disappearing. I'm not quite sure where it is getting Jan from though.

 
Posted : 14/07/2020 5:47 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

EDIT: Velouria posted while I was looking at the workbook 🙂

 

Hi John,

On the 'Schedule 2020' sheet, cell E10 is part of the header row for the table 'Table12'.

Table header rows can't contain formulas.  So when you try to enter something like =E1 it gets converted to static text.

I'm not sure how it works out what to convert to when you feed it a date, but as you already have a header Jan, it's giving you Jan2.  You'll get Jan3 in F10 etc.

Regards

Phil

 
Posted : 14/07/2020 5:59 am
(@lanser)
Posts: 61
Estimable Member
Topic starter
 

Doh!!!

I didnt even realise I had made it a tableEmbarassed

 

Thanks guys

 
Posted : 14/07/2020 10:42 am
Share: