LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Combine 2 columns in a dynamic range into one

Great! very nearly there. I have applied the same code to run this for 3 seperate lists at teh same time (3 lists are all of different lengths)

So the code I am using is ....



Sub Concatenate()

Dim LRow As Long

LRow = Sheets("SquadLists Import").Cells(Rows.Count, 1).End(xlUp).Row

'Podium List

With Sheets("SquadLists")
.Range("A2:A" & LRow).ClearContents
With .Range("A2:A" & LRow)
.Formula = "='Squadlists Import'!A2&"" ""&'Squadlists Import'!B2"

.Value = .Value
End With
End With


'PP List

With Sheets("SquadLists")
.Range("B2:B" & LRow).ClearContents
With .Range("B2:B" & LRow)
.Formula = "='Squadlists Import'!C2&"" ""&'Squadlists Import'!D2"

.Value = .Value
End With
End With


'Historical List

With Sheets("SquadLists")
.Range("C2:C" & LRow).ClearContents
With .Range("C2:C" & LRow)
.Formula = "='Squadlists Import'!E2&"" ""&'Squadlists Import'!F2"

.Value = .Value
End With
End With

End Sub




However the range to copy gets set by this line meaning that if the second list is longer than the first not everything gets copied over. I have tried to include this within each WITH statement, but it dosent allow multiple Dim LRow statements in the same process.


Dim LRow As Long

LRow = Sheets("SquadLists Import").Cells(Rows.Count, 1).End(xlUp).Row



Thanks so much for your help!


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Range for multiple columns Robin Excel Discussion (Misc queries) 8 April 3rd 23 02:26 PM
creating a dynamic range based on criteria, within a dynamic range, and passing it to a function [email protected] Excel Programming 0 October 9th 07 05:22 PM
Drawing data from specific columns of a dynamic range Darren Setting up and Configuration of Excel 3 March 3rd 06 06:53 AM
Using specific columns of a dynamic range Darren Excel Programming 0 March 2nd 06 10:27 AM
Counting Columns in Dynamic Range ExcelMonkey[_102_] Excel Programming 1 March 4th 04 10:22 PM


All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"