KD11
(KD)
1
Hello guys,
I’m reading customer info from a sheet but the customer names are merged with other cells in the column.
How can I attribute the customer name to all the cells of merged cells?
Currently I’m getting a blank.
Each cell of B column should give me the name rather than a blank.
thanks!

Anil_G
(Anil Gorthi)
2
@KD11
When the ceels are merged ideally you will get data in only one cell and that cell usually is the first cell of the merged cells…
In your case we can see there are 3 rows for each name associated with it
You can assume the same that the name will not change till next name comes in …so follow the steps
Create a variable of type string str and give default value as string.Empty
- Read the data into datatable dt
- use a for each row indatatabe activity on dt
- Now inside it use if condition with
IsNothing(currentrow("columnname")) andAlso String.IsNullOrEmpty(Currentrow("columnname").ToString
- On then side use
currentrow("columnname") = str
and on else side use str = currentrow("columnname").ToString
At the end of loop all the blank values will be replaced with the required values
Cheers
1 Like