crazysenses
New Member
- Joined
- Jan 3, 2014
- Messages
- 2
Hello experts, i nned your help im trying to do the following macro.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]a[/TD]
[TD]b[/TD]
[TD]c[/TD]
[/TR]
[TR]
[TD]node1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]node2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]node3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]node1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]node4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The macro needs to find the text "node1 ", and move to B1 and write PLATFORM1,
so for the next row, find the text "node2", and move to B2 ant wirte PLATFORM2, then node 3 and move to B3.
I have this
Cells.Replace What:="node1", Replacement:="PLATFORM1"
Cells.Replace What:="node2", Replacement:="PLATFORM2"
Cells.Replace What:="node3", Replacement:="PLATFORM1"
But this replace the content, and i want the new text will wriiten in the next cell.
Thten i try this, but it only execute for the first fild i select and i need to be executed for all the cells i select.
Cells.Find What:="node1"
ActiveCell.Offset(0, 1).FormulaR1C1 = "PLATFORM1"
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]a[/TD]
[TD]b[/TD]
[TD]c[/TD]
[/TR]
[TR]
[TD]node1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]node2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]node3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]node1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]node4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The macro needs to find the text "node1 ", and move to B1 and write PLATFORM1,
so for the next row, find the text "node2", and move to B2 ant wirte PLATFORM2, then node 3 and move to B3.
I have this
Cells.Replace What:="node1", Replacement:="PLATFORM1"
Cells.Replace What:="node2", Replacement:="PLATFORM2"
Cells.Replace What:="node3", Replacement:="PLATFORM1"
But this replace the content, and i want the new text will wriiten in the next cell.
Thten i try this, but it only execute for the first fild i select and i need to be executed for all the cells i select.
Cells.Find What:="node1"
ActiveCell.Offset(0, 1).FormulaR1C1 = "PLATFORM1"