Forum Discussion
CHende77
Mar 28, 2022Copper Contributor
Creating a larger table from input data
Hello experts, I am using excel (version 2202) on a PC with windows 10. I have a situation where I need to input x and y coordinates in a table and automatically receive a larger list of coordinates...
- Mar 28, 2022
Here is a macro that will create the output range:
Sub CreateOutput() Dim s As Long Dim t As Long Dim m As Long Application.ScreenUpdating = False Range("D3:E" & Rows.Count).ClearContents m = Range("A" & Rows.Count).End(xlUp).Row s = 3 t = 3 For s = 3 To m If s > 3 And Range("B" & s).Value <> Range("B" & s - 1).Value Then Range("D" & t).Value = Range("A" & s).Value Range("E" & t).Value = Range("B" & s - 1).Value t = t + 1 End If Range("D" & t).Value = Range("A" & s).Value Range("E" & t).Value = Range("B" & s).Value t = t + 1 Next s Application.ScreenUpdating = True End Sub
Starrysky1988
Mar 28, 2022Iron Contributor
If you are office365 user, you may carry out as per below.
There will be 5 steps to get the result you want.
- CHende77Mar 28, 2022Copper ContributorThank you, very nice approach to this problem!