AusSteelMan
Board Regular
- Joined
- Sep 4, 2009
- Messages
- 208
Hi,
I have a workbook where one sheet uses information on 2 hidden sheets 1. for drop down dynamic range references; and
2. for lookup references
I am working on a template workbook where the main sheet has headings in Row 1 (A to AE and in hidden helper columns BA to BE). Rows 2 to 5 are blank except for forumla in K, O and BA to BE). Cells A1 to AE5 have borders.
I also have a filled in example sheet with around 400 lines below the heading.
I have the StringConcat function (Credit to Chip Pearson) in Module 1 of my VBAProject.
Also in Module 1 is several simple Subs, none of which directly call on the Function.
I also have some sheet code on my only visble sheet.
PROBLEM
The problem I am having is that when some of the module based Subs run, the function code starts (many loops in that code) mid stream, and I have no idea why.
Note:
The subs and function all work succesfully, but are just slow in exectuing, especially when there are around 400 lines in a completed worksheet
A couple of my codes are not effected, but 1 is effected sevral times while executing. I can really notice the lag when processing what should be simple tasks. The status bar shows calculation %age: it takes 5 to 8 seconds of lag to do anything while it calculates.
To check, I used the Breakpoint and the End statement of the function and stepped to see what happens next. The result was 10 complete cycles of the function code - where there is no apparent action taking place. Unfortunately, the UDF code has many For Each loops.
Note:
I cannot figure out why it is even doing it 10 times. The function is not used on the sheet 10 times (4 times in the template and 400 times in the example)
I am happy to post code if someone thinks they can help, or even send the whole workbook if appropriate.
Can anybody offer help. I am getting short on time and ability to just sit here and fault find.
Regards and thanks,
ASM
I have a workbook where one sheet uses information on 2 hidden sheets 1. for drop down dynamic range references; and
2. for lookup references
I am working on a template workbook where the main sheet has headings in Row 1 (A to AE and in hidden helper columns BA to BE). Rows 2 to 5 are blank except for forumla in K, O and BA to BE). Cells A1 to AE5 have borders.
I also have a filled in example sheet with around 400 lines below the heading.
I have the StringConcat function (Credit to Chip Pearson) in Module 1 of my VBAProject.
Also in Module 1 is several simple Subs, none of which directly call on the Function.
I also have some sheet code on my only visble sheet.
PROBLEM
The problem I am having is that when some of the module based Subs run, the function code starts (many loops in that code) mid stream, and I have no idea why.
Note:
The subs and function all work succesfully, but are just slow in exectuing, especially when there are around 400 lines in a completed worksheet
A couple of my codes are not effected, but 1 is effected sevral times while executing. I can really notice the lag when processing what should be simple tasks. The status bar shows calculation %age: it takes 5 to 8 seconds of lag to do anything while it calculates.
To check, I used the Breakpoint and the End statement of the function and stepped to see what happens next. The result was 10 complete cycles of the function code - where there is no apparent action taking place. Unfortunately, the UDF code has many For Each loops.
Note:
I cannot figure out why it is even doing it 10 times. The function is not used on the sheet 10 times (4 times in the template and 400 times in the example)
I am happy to post code if someone thinks they can help, or even send the whole workbook if appropriate.
Can anybody offer help. I am getting short on time and ability to just sit here and fault find.
Regards and thanks,
ASM