I have a list generated from my ERP system as an excel file. It is a list of customers and what city//state/country they are located in. If there are multiple purchases from the same a customer, their name will show up blank for all following transactions after.
Example:
Customer A Chicago IL, USA
Customer B Nashville TN, USA
Nashville TN, USA
Customer C Detroit MI, USA
Detroit MI, USA
Detroit MI, USA
Customer D Atlanta GA, USA
I am trying to use a for loop to fill in the blanks, but I am struggling to get it working. I am attempting a for loop that when it reads a blank cell, it writes the cell above it, but I am struggling with that. Any suggestions?
For Each Row in yourDT
– If NOT String.IsNullOrEmpty(CurrentRow(“Column Name”).ToString.Trim)
— Then Assign CurrentCustomerName = CurrentRow(“Column Name”).ToString.Trim
— Else CurrentRow(“Column Name”) = CurrentCustomerName
Basically as you’re looping if the value is not empty stick it in a variable. If the value is empty, overwrite it with what’s in the variable.