Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excel Row and Change the number

I have an excel file that has a Name in column 1 and a Flag (1 or 0) in column 2. Based on a login (section access) my macro can find the row (persons login name) I need to go to, but I can't seem to get to column 2. The code below will delete the row but how do I move to column 2 and change the number in that column?

sub MessageBox

Set oXL=CreateObject("Excel.Application")

set doc = ActiveDocument

doc.fields("DSMSYOUGET").SelectAll

set mySelection = doc.fields("DSMSYOUGET").GetSelectedValues

strIndex = (mySelection.Item(i).text)

msgbox (strIndex)

f_name = "Q:\Developers\SCharles\QlikViewSJC\DSMZone\MessageBoxControl.xls"

set oWB = oXL.Workbooks.Open(f_name)

set oSH = oWB.Worksheets.Item(1)

oSH.Cells.Find(strIndex, , , 2, 1, 2, 0).EntireRow.Delete

oWB.Save

oWB.Close

set oSH = Nothing

set oWB = nothing

set oXL = nothing

msgbox("Done")

End sub

Thanks,

Stephen

1 Reply
Not applicable
Author

Good question... anyone know this?