Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

After If statement, procedure doent work



  • Please log in to reply
2 replies to this topic
Vanda_a
  • Members
  • 29 posts
  • Last active: Oct 28 2015 01:28 PM
  • Joined: 24 Sep 2015

Dear All

 

Somebody helps please.

I have no idea why it doesnt work

^+v::
Clipboard =
FileSelectFile, Path, 3, , Open Excel File, Excel File (*.xls; *.xlsx)
if Path =
	ExitApp 
Xl := ComObjCreate("Excel.Application")
Xl.Visible := True
WB := Xl.Workbooks.Open(Path)

For Sheet in Xl.Worksheets
If (Sheet.Name = "Sheet1" or Sheet.Name = "Sheet2")
 {
 LastRow := Sheet.Cells(Sheet.Rows.Count, 1).End(xlUp := -4162).Row
 Loop, %LastRow%
  {
   MyVar := Sheet.Cells.Find("No.").Row
   MyVar1 := Sheet.Cells.Find("Description").Row
    If MyVar = %MyVar1%
     {
     A%A_Index% := Sheet.Cells.Find("Lot").Offset(0,1).Value ;;;;;;;;;;;;Here Not Working
     Msgbox, A%A_Index%
     }
  }
 }
Xl.Application.Quit
Return

I would be grateful and thankful if I am helped



Vanda_a
  • Members
  • 29 posts
  • Last active: Oct 28 2015 01:28 PM
  • Joined: 24 Sep 2015

Mistake on this line

Msgbox, A%A_Index%

Should be this Msgbox, % A%A_Index%

 

Problem solved. Thank you



kon
  • Members
  • 1652 posts
  • Last active:
  • Joined: 04 Mar 2013
✓  Best Answer

edit: nevermind