Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do we change a cell value using VBA Macro?

I need to change cell values in listbox .
I am able to retrieve those cell values:

Sub ClearList()
set ListBox = ActiveDocument.GetSheetObject("LB01")
for i =0 to 2
Set cell = listBox.GetCell(i,0)
MsgBox(cell.text)
next
End Sub

My MsgBox read the values correctly, but my goal is to (1) wipe out old values and (2) re-insert a new set of values.

Which VBA function I can use to wipe and re-insert?

Thanks!

1 Reply
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Paul,

you can't simply replace values in a list box, unless it's an INPUTFIELD. For INPUTFIELD, you can use an API "SetInputFieldCell".