Link events to new block

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Link events to new block

Post by Rudi »

Hi,

Please see the attached workbook for details and question...
TX
Test Form.xlsm
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Link events to new block

Post by HansV »

You can't rely on fixed cells, nor on named ranges that refer to fixed cells, such as BMark and PType.
Going by the current setup, the role of PType is played by B10, B27, B44, ...
So you could change the line

Code: Select all

    If Not Intersect(Range("PType"), Target) Is Nothing Then
to

Code: Select all

    If Target.Row Mod 17 = 10 And Target.Column = 2 Then
and similar for others. But is it really worth the trouble? It's probably going to be a lot of work to get it correct...
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Link events to new block

Post by Rudi »

It is a bit more trouble than what it's worth.
I'll have to chat with the requester and see if I can approach this part of the form differently.

TX for the guidance.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Link events to new block

Post by Rudi »

OK...taking new approach...but now I have a simple issue I cannot seem to resolve???

Please see attached...
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Link events to new block

Post by HansV »

You're mixing A1-style and R1C1-style references.
Target.Offset(8).Address returns an A1-style address.
valLists!R2C3:R10C9 is an R1C1-style address.
You could use either R1C1:

Code: Select all

        Target.Offset(9).FormulaR1C1 = "=IFERROR(VLOOKUP(" & _
            Target.Offset(8).Address(ReferenceStyle:=xlR1C1) & _
            ",valLists!R2C3:R10C9,3,0),"""")"
or A1:

Code: Select all

        Target.Offset(9).Formula = "=IFERROR(VLOOKUP(" & _
            Target.Offset(8).Address & ",valLists!C2:I10,3,0),"""")"
and similar for the others.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Link events to new block

Post by Rudi »

:groan: Many TX.
This one got me good; not even coffee helped me resolve it!!!!
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Link events to new block

Post by HansV »

Perhaps you should change the declaration

Dim sngEspresso As Single

to

Dim dblEspresso As Double

:innocent:
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Link events to new block

Post by Rudi »

:laugh:
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.