![]() |
|
#1
|
|||
|
|||
|
I am trying to create VBA code that will allow a user select a range of data and recombine records split between two lines into a single line and remove the blank lines. See attached images of the data Before and what is expected after processing.
Below is code i tried Code:
Sub GetRowData()
Dim Myrange As Range
Dim Myrow As Range
Set Myrange = Selection
Dim strVal As String
Dim sHold As String
For Each Myrow In Myrange.Rows
If Myrow.Row Mod 2 = 0 Then
strVal = Myrow.Columns(1).Cells
Myrow.Columns(1).Value = ""
'MsgBox Myrow.Offset(1, -1).Address
'Myrow.Offset(1, -1).Cells = strVal
ActiveCell.Offset(1, -1).Value = strVal
End If
Next Myrow
End Sub
Last edited by Pecoflyer; 02-28-2019 at 12:31 AM. Reason: Added code tags |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Grouping multiple excel records in to a single letter
|
lmjb1964 | Mail Merge | 4 | 04-04-2018 03:33 PM |
| Split sum of one single row | FTL | Excel | 2 | 11-21-2017 12:54 AM |
Merging multiple excel records in to a single word doc?
|
dns_to | Mail Merge | 1 | 10-20-2017 01:22 PM |
How do I mail merge records into table columns with more than one merge field?
|
tech123 | Mail Merge | 1 | 04-26-2017 07:13 PM |
How to combine several records in a single letter in Word 2010
|
May | Mail Merge | 3 | 03-25-2015 03:36 AM |