Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Good question... anyone know this?