seattletimebandit
Board Regular
- Joined
- Apr 11, 2013
- Messages
- 69
Hello!
I have a bit of code that manipulates data starting in a specific cell. Trying to figure out how to do this by asking the user to select the range, not matter where the table of data is located. The code I have now:
Before code:
<tbody>
</tbody>
After code:
<tbody>
</tbody>
I'm working on it, and have the Msg Box bit for selecting the range, but not sure how to run the macro on the selection. There would only be 1 row, but number of columns is variable.
Thanks!
Russell
I have a bit of code that manipulates data starting in a specific cell. Trying to figure out how to do this by asking the user to select the range, not matter where the table of data is located. The code I have now:
Code:
Sub SplitDepthsFromSampleID()
Dim ID As String
ID = Left(Range("B1").Value, InStrRev(Range("B1").Value, "-") - 1)
Range("A1").Value = ID
Range("B1", Cells(1, Columns.Count).End(xlToLeft)).Replace ID & "-", "", xlPart, , , , False
End Sub
Before code:
Text-1 | Text-2 | Text-3 | Text-4 | Text-5 |
<tbody>
</tbody>
After code:
Text | 1 | 2 | 3 | 4 | 5 |
<tbody>
</tbody>
I'm working on it, and have the Msg Box bit for selecting the range, but not sure how to run the macro on the selection. There would only be 1 row, but number of columns is variable.
Thanks!
Russell