Hello
Cell N15 may contain the text
<tbody>
</tbody>
Depending on text in cell I want macro to cellect the sertain cells. If N15 contains "N 003." then select G2, if text in N15 if "N 004." Then sellect "G3" etc
I can do it this way.
but how I can shorten the code to not type all ranges ?
Thank you
Cell N15 may contain the text
N 003. |
N 004. |
N 022. |
N 040. |
N 049. |
N 071. |
N 073. |
N 081. |
N 087. |
N 090. |
N 091. |
N 093. |
N 095. |
N 098. |
N 099. |
N 103. |
N 115. |
N 119. |
N 121. |
N 127. |
N 133. |
N 146. |
N 164. |
N 166. |
N 169. |
N 173. |
N 179. |
N 180. |
N 184. |
N 186. |
N 187. |
N 196. |
N 198. |
N 205. |
<tbody>
</tbody>
Depending on text in cell I want macro to cellect the sertain cells. If N15 contains "N 003." then select G2, if text in N15 if "N 004." Then sellect "G3" etc
I can do it this way.
Code:
If Range("N15").Text = "N 003." Then
Range("G2").Select
End If
If Range("N15").Text = "N 004." Then
Range("G3").Select
End If
If Range("N15").Text = "N 022." Then
Range("G4").Select
End If
If Range("N15").Text = "N 040." Then
Range("G5").Select
End If
and so on.
but how I can shorten the code to not type all ranges ?
Thank you