I do not know why this does this. But I was able to work around the problem. Please try this...
Maybe try declaring the FSO as Object. "Dim FSO" without a declaration declares the FSO as a variant. Just a...
Each block is a named range. There are 6 Key colors which are based on the information in column “Y”(Rental...
I cleaned up the code. This will place next month and year in cell A1. So today is Sep30 2018...
This was tested in a blank worksheet (no data). The macro will place next Month and Year in cell A1....
Updated the code to include the possibility of blank cells in the raw data. If a blank cell is found...
Lets try this again. You will need 3 sheets. Sheet1, Sheet 2 and Sheet3 Sheet1 your raw data Sheet2 is...
Hey Thank you so much. Apologies for not been very clear on the question. Using your example, in the output...
What is wrong with this code?
Dim lrow As Integer
lrow = ThisWorkbook.Sheets("SHEET1").Cells(Rows.Count, 11).End(xlUp).row
Dim row As Integer
Dim srow As Integer
Dim hrow As Integer
srow = 5
row = 5
hrow = 1
Do While Cells(row, 11) <> ""
Cells(row, 13) = Cells(row, 11)
row = row + 1
Do While Cells(srow, 12) <> ""
Cells(lrow + hrow, 13) = Cells(srow, 12)
srow = srow + 1
hrow = hrow + 1
Welcome to our Forum.
The issues in you code are ,:
Please see the below code to concatenate note stings in two columns:
Dim StartRow As Integer
Dim LastRow As Integer
LastRow = ThisWorkbook.Sheets("SHEET1").Cells(Rows.Count, 11).End(xlUp).row
StartRow = 5
Do While StartRow <= LastRow
Cells(StartRow, 13) = Cells(StartRow, 11) & " " & Cells(StartRow, 12)
StartRow = StartRow + 1
Hope this helps!
Thank you for your quick response but iam not looking to concatenate …iam looking it put them in one single column one after the other,,,if a column has names a,b,c,d,e…till some row and another column has w,x,y,z then when i click a button my thrd column should have a,b,c,d,e,w,x,y,z in one single column
Thanks, now I understand your requirement, after reading your example. Please check the below procedure:
Dim iCntr, startRow, lrowCol1, lrowCol2, cntrCol3 As Integer
startRow = 5
cntrCol3 = startRow
'Check the last row in Column 11 and enter them in column 13
lrowCol1 = ThisWorkbook.Sheets("SHEET1").Cells(Rows.Count, 11).End(xlUp).Row
For iCntr = startRow To lrowCol1
If Trim(Cells(iCntr, 11)) <> "" Then
Cells(cntrCol3, 13) = Cells(iCntr, 11)
cntrCol3 = cntrCol3 + 1
'Check the last row in Column 12 and append them in column 13
lrowCol2 = ThisWorkbook.Sheets("SHEET1").Cells(Rows.Count, 12).End(xlUp).Row
For iCntr = startRow To lrowCol2
If Trim(Cells(iCntr, 12)) <> "" Then
Cells(cntrCol3, 13) = Cells(iCntr, 12)
cntrCol3 = cntrCol3 + 1
Please share using the share button above.
If you found the answer is best answer for your question, Please mark as 'best answer' by clicking on the right tick mark icon at the left side of the answer.
Found the answer useful and wants to credit the user, then vote the answer (vote up).