Thanks for any help!
I am trying to speed up a process for my job where instead of copying and pasting all of the values into one field, I can run a macro to put it all into one field for me.
How the field comes to me is with a merged cell of "Responsibility / Duty:" and all the fields to the right need to be included. Then there could be a few rows in between and needs to have all of those values included as well.
[TABLE="width: 175"]
<tbody>[TR]
[TD][/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Responsibility / Duty:[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Other field[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Responsibility / Duty:[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
I've pulled a concatinate all cell values function, but it's selecting the range of cells that I'm unsure the best method of doing. Any help is appreciated!
I am trying to speed up a process for my job where instead of copying and pasting all of the values into one field, I can run a macro to put it all into one field for me.
How the field comes to me is with a merged cell of "Responsibility / Duty:" and all the fields to the right need to be included. Then there could be a few rows in between and needs to have all of those values included as well.
[TABLE="width: 175"]
<tbody>[TR]
[TD][/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Responsibility / Duty:[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Other field[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Responsibility / Duty:[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
I've pulled a concatinate all cell values function, but it's selecting the range of cells that I'm unsure the best method of doing. Any help is appreciated!
PHP:
Function ConcatinateAllCellValuesInRange(sourceRange As Excel.Range) As String
Dim finalValue As String
Dim cell As Excel.Range
For Each cell In sourceRange.Cells
finalValue = finalValue + CStr(cell.Value) + Chr(10)
Next cell
ConcatinateAllCellValuesInRange = finalValue
End Function