goodysgotacuda
Board Regular
- Joined
- Jun 27, 2014
- Messages
- 51
Hello!
I am trying to get the following code to work as I would like it to, but am getting hung up. I have ~29 columns of data that come back to be, the columns can be scrambled in and order. What I would like to do is take Latitude, Longitude, and Altitude, select them, copy and paste to another sheet.
So far I can get it to either find and select all three headers only, or it will select more than one all the way down if they are neighbors. So the following code as shown will select C1:D1 to the last row of data, I'd like to do include F1:xlDown in that as well.
Any help? Thanks!
<tbody>
</tbody>
I am trying to get the following code to work as I would like it to, but am getting hung up. I have ~29 columns of data that come back to be, the columns can be scrambled in and order. What I would like to do is take Latitude, Longitude, and Altitude, select them, copy and paste to another sheet.
So far I can get it to either find and select all three headers only, or it will select more than one all the way down if they are neighbors. So the following code as shown will select C1:D1 to the last row of data, I'd like to do include F1:xlDown in that as well.
Code:
Dim GPS1 As Range, GPS2 As Range
Dim GPS3 As Range, All As Range
Set GPS1 = Range("A1:AZ1").Find("Latitude")
Set GPS2 = Range("A1:AZ1").Find("Longitude")
Set GPS3 = Range("A1:AZ1").Find("Altitude)")
Set All = Union(GPS1, GPS2, GPS3)
Range(All, All.End(xlDown)).Select
Any help? Thanks!
| A | B | C | D | E | F |
1 | RPM | Torque | Latitude | Longitude | MPH | Altitude |
2 | 1000 | 900 | 33 | 92 | 25 | 1000 |
<tbody>
</tbody>