Excel 2010 VBA change a table value in a for loop [Solved/Closed]

mpbc4851 1 Posts Wednesday August 14, 2013Registration date August 14, 2013 Last seen - Aug 14, 2013 at 08:19 AM - Latest reply: TrowaD 2433 Posts Sunday September 12, 2010Registration dateContributorStatus September 17, 2018 Last seen
- Aug 19, 2013 at 11:03 AM
Hello,

This should be simple, but I can't figure it out or find the answer.

I need the proper line of code to change a cells value in a table while inside a for loop.

My code is very simple:

For Each row In [Table2].Rows
Memail = (row.Columns(1).Value)
Mname = (row.Columns(2).Value)
Maddress = (row.Columns(3).Value)
'etc. etc. do some stuff
replace (row.Columns(16).Value) with TRUE
Next

I can't figure out the code to replace column 16 with TRUE for each iteration.

Thank you for all of your help,
Mike

See more 

1 reply

Best answer
TrowaD 2433 Posts Sunday September 12, 2010Registration dateContributorStatus September 17, 2018 Last seen - Aug 19, 2013 at 11:03 AM
1
Thank you
Hi,

Try replacing:
replace (row.Columns(16).Value) with TRUE
with:
Row.Columns(16).Value = True

Best regards,
Trowa

Thank you, TrowaD 1

Something to say? Add comment

CCM has helped 1805 users this month