XLM4.0 Macro Confusion

ExcelChampion

Well-known Member
Joined
Aug 12, 2005
Messages
976
I'm updating some old code because the workbooks are getting very cumbersome and its time to join the 21st century.

I'm confused by the highlighted lines below. Somehow, when the message box is displayed it says "DV0=22". What I don't undertand is where does the 22 come in? What am I missing? Maybe someone else can spot it.

Code:
GoSoft
TRUE
db=TRUE
=SET.NAME("BTILE",FALSE)
=SET.VALUE(Layout_Index,113)
maxside=3
getmore=TRUE
badcount=FALSE
=SET.VALUE(Lookup_Tables!$H$28,1)
maxitem=20
itemcount=Lookup_Tables!$H$28
=MarkName()
=SET.NAME("BlankSheet",ActDocName)
ActivePlan=1
=SET.VALUE(Layout,FALSE)
=SET.VALUE(Lookup_Tables!$H$5,1)
SideIndex=1
=ECHO(FALSE)
=GetHead()
=ECHO(TRUE)
=DIALOG.BOX(DialogBox0)
=IF(DV0=FALSE)
=  ALERT("### Job Aborted",2)
=  HALT()
=END.IF()
[COLOR="Red"][SIZE="5"]=IF(db=TRUE,ALERT("DV0 = "&DV0,2))
=IF(DV0=22,DoHead())[/SIZE][/COLOR]

=WHILE(getmore)
=  DIALOG.BOX(DialogBox1)
= IF(db=TRUE,ALERT("DVal1 ="&DVal1,2))
=IF(DVal1=33,DoDim())
=IF(DVal1=34,UnDoDim())
=IF(DVal1=35,DoTiles())
=IF(DVal1=99,DoAcc())
=IF(DVal1=46,DoAccept())
=IF(DVal1=47,DoItem())
=IF(DVal1=48,DoDone())

=IF(DVal1=FALSE)
=   ALERT("### Do you want to Abort Job?",1)
=   IF(L36_)
=    ALERT("### Job Aborted",3)
=    HALT()
=  ELSE.()
=    ALERT("Re-Enter",2)
=   END.IF()
= END.IF()
=NEXT()
=RETURN()

MarkName
=GET.CELL(32,ACTIVE.CELL())
=IF(NOT(ALERT("Active Document is "&ActDocName,1)))
=  ALERT("###Operation Aborted",3)
= HALT()
= END.IF()
=RETURN()

GetHead

=ACTIVATE(BlankSheet)
=SELECT("r1c1")
=SET.VALUE(Acct,DEREF(ACTIVE.CELL()))
=SET.VALUE(ACCT_IND,0)
=SELECT("r1c2")
=SET.VALUE(JOB,DEREF(ACTIVE.CELL()))
=SELECT("r2c2")
=SET.VALUE(Sub,DEREF(ACTIVE.CELL()))
=SET.VALUE(SUB_IND,0)
=SELECT("r3c2")
=SET.VALUE(Client,DEREF(ACTIVE.CELL()))
=SELECT("r4c2")
=SET.VALUE(Disc_Cd,DEREF(ACTIVE.CELL()))
=SET.VALUE(DISC_CD_IND,0)
=IF(db=TRUE,ALERT("Get Head Done",2))
=RETURN()

DoHead
=ACTIVATE(BlankSheet)
=SELECT("r1c1")
=FORMULA(Acct)
=SELECT("r1c2")
=FORMULA(JOB)
=SELECT("r2c2")
=FORMULA(Sub&" - #"&Lot&" - "&Plan)
=SELECT("r3c2")
=FORMULA(Client)
=SELECT("r4c2")
=FORMULA(Disc_Cd)
=IF(db=TRUE,ALERT("Do Head Done",2))
=RETURN()

DoAccept

=IF(getmore=FALSE,RETURN())
=SET.VALUE(itemcount,Item)
SideIndex=Lookup_Tables!$H$5
=IF(itemcount<1,badcount=TRUE)
=IF(itemcount>maxitem,badcount=TRUE)
=IF(db=TRUE,ALERT("itemcount = "&itemcount,2))
=ACTIVATE(BlankSheet)

=(((itemcount-1)*5)+9)
=IF(db=TRUE,ALERT("ActiveRow = "&ActiveRow,2))
=IF(db=TRUE,ALERT("SideIndex = "&SideIndex,2))
=(((ActivePlan-1)*7)+SideIndex+4)
=IF(db=TRUE,ALERT("ActiveCol = "&ActiveCol,2))

=SELECT("r"&ActiveRow&"c1")
=IF(Room=0," ",FORMULA(Room))
=SELECT("r[1]c")
=IF(Name=0," ",FORMULA(Name))
=SELECT("r[-1]c2")
=IF(Layout_Index<200,FORMULA(CHOOSE(View,"RI","WIC")))
=IF(Layout)
=  SELECT("r[-1]c")
=  PASTE()
=  SELECT("r[1]c")
=  SET.VALUE(Layout,FALSE)
=  SET.NAME("BTILE",FALSE)
=END.IF()
=SELECT("rc"&ActiveCol)
=IF(Style=0," ",FORMULA(Style))
=SELECT("r[1]c")
=FORMULA(Length)
=SELECT("r[1]c")
=FORMULA(CHOOSE(Type,"W","L","D")&CHOOSE(AlignL,"[","(","#")&CHOOSE(AlignR,"]",")","#"))

DoItem

=IF(View=1)
SideIndex=1
=  SET.VALUE(Lookup_Tables!$H$5,SideIndex)
=  SET.VALUE(itemcount,itemcount+1)
=  SET.VALUE(Item,itemcount)
=  IF(Layout_Index>200,SET.VALUE(Layout_Index,Layout_Index-100))
=ELSE()
=  IF(SideIndex>maxside-1)
=   IF(db=TRUE,ALERT("# Maximum sides reached",2))
SideIndex=1
=  SET.VALUE(itemcount,itemcount+1)
=  SET.VALUE(Lookup_Tables!$H$5,SideIndex)
=  SET.VALUE(Item,itemcount)
=  IF(Layout_Index>200,SET.VALUE(Layout_Index,Layout_Index-100))
=  ELSE()
SideIndex=SideIndex+1
=    SET.VALUE(Lookup_Tables!$H$5,SideIndex)
=    IF(SideIndex=2,SET.VALUE(AlignL,3),SET.VALUE(AlignL,1))
=    IF(SideIndex=2,SET.VALUE(AlignR,3),SET.VALUE(AlignR,1))
= END.IF()
=  IF(db=TRUE,ALERT("SideInd="&SideIndex&"  Item="&Item))
=END.IF()
=SET.VALUE(Style,0)
=SET.VALUE(Length,0)

=RETURN()

DoDone

=  SET.NAME("getmore",FALSE)
=  ALERT("Ready to draw plans and price",2)
= 'C:\Documents and Settings\bardont\Local Settings\Temp\GoQuote.XLM'!GoQuote()

=RETURN()

DoDim
=ACTIVATE("CSoft.XLM")
=SELECT("r6c5")
sideindex=1
=SET.VALUE(Lookup_Tables!$H$5,SideIndex)
=FOR("i",1,maxside-1,1)
=SELECT("r[1]c")
=IF(GET.CELL(5)<100,SET.VALUE(ACTIVE.CELL(),GET.CELL(5)+200))
=NEXT()
=SELECT("r21c")
=IF(GET.CELL(5)<100,SET.VALUE(ACTIVE.CELL(),GET.CELL(5)+200))
=SET.VALUE(AlignL,1)
=SELECT("r26c")
=IF(GET.CELL(5)<100,SET.VALUE(ACTIVE.CELL(),GET.CELL(5)+200))
=SET.VALUE(AlignR,1)
=RETURN()

UnDoDim
=ACTIVATE("CSoft.XLM")
=SELECT("r6c5")
sideindex=1
=SET.VALUE(Lookup_Tables!$H$5,SideIndex)
=FOR("i",1,maxside-1,1)
=SELECT("r[1]c")
=IF(GET.CELL(5)>200,SET.VALUE(ACTIVE.CELL(),GET.CELL(5)-200))
=NEXT()
=SELECT("r21c")
=IF(GET.CELL(5)>200,SET.VALUE(ACTIVE.CELL(),GET.CELL(5)-200))
=SET.VALUE(AlignL,1)
=SELECT("r26c")
=IF(GET.CELL(5)>200,SET.VALUE(ACTIVE.CELL(),GET.CELL(5)-200))
=SET.VALUE(AlignR,1)
=RETURN()

DoTiles

=IF(db=TRUE,ALERT("DoTiles",2))

=IF(NOT(BTILE))
=  ALERT("Select Customized VIEW",2)
=  ACTIVATE("SS-VIEW.XLS")
=  HALT()
=END.IF()
=COPY()
=ALERT("Layout is selected",2)
=IF(Layout_Index<200,SET.VALUE(Layout_Index,Layout_Index+100))
=GOTO(startloop)



FromTile

=IF(ALERT("Are You Sure?",1))
=  SET.NAME("BTILE",TRUE)
=ELSE()
= ALERT("Click again!",2)
= SET.NAME("BTILE",FALSE)
=END.IF()
=  GOTO(DoTiles)
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

ExcelChampion

Well-known Member
Joined
Aug 12, 2005
Messages
976
Here's the Dialog table:
CSOFT.xls
ABCDEFGH
56DIALOGBOX0530300JOBDEFINITION
57Job#51115&Job#
586689119Instructions
59Acct51244&Acct
6065340135Label
6116536913784ACCTS#N/A
62Subdivision514164&Sub
636541601360
64165418814183SUBS#N/A
65Lot#521813&Lot#
666265785
67Plan521844&Model
6862643985
69Client521775&Client
70626573162GoSoft
71DiscCd5219107&Discount
72631010485TRUE
73163101338675DISC#N/A
74Tax-Option142272046965&Taxable
75111
7612Y
7712N
78OK145323564OK
79Cancel245327064Cancel
80Clone-Check313359436619CloneFALSE
Lookup_Tables
CSOFT.xls
ABCDEFGH
83231530300ACCESSORIES
84Items51115Item#
8576610501
86Room51245Room
8766742119
88Name51374Name
8966774162
90Side524126Side
9166712422A
92Notes5234192Notes
936285188140
94Code527575Code
9563207294
96163211069373CODE7
97OK145323564OK
98Cancel245327064Cancel
99Style519157Style
10066715585
101527842Qty
102831940943
Lookup_Tables
 

Watch MrExcel Video

Forum statistics

Threads
1,122,462
Messages
5,596,280
Members
414,051
Latest member
tabecker

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
Top