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...
I am hoping you can help me with a basic VBA code. I would like to copy two ranges from one worksheet to another worksheet in the same workbook. I have created a code that accomplishes this but I cannot figure out how to get it not to override previous information that is already there as it should go to the empty row underneath the row that already has information from a previous copy and paste function. For example I want to copy range A62:I65 and H1 from sheets(“GIS”) to sheets(“GIS Comments”) A2 and A3. Then when there is new information in sheets (“GIS”) copy the same range A62:I65 and H1 from sheets(“GIS”) to sheets(“GIS Comments”) in the next available empty rows and so on (therefore not overriding information that is already in sheets(“GIS Comments”.
The below macro will help you to copy the data and paste at next available Row in the other worksheet.
'find LastRow in Target Sheet
Dim lastRow As Long
Dim strTargetSheet As String
strTargetSheet = "GIS Comments"
lastRow = Sheets(strTargetSheet).Cells.SpecialCells(xlLastCell).Row
lRow = Sheets(strTargetSheet).Cells.SpecialCells(xlLastCell).Row
Do While Application.CountA(Sheets(strTargetSheet).Rows(lRow)) = 0 And lRow <> 1
lRow = lRow - 1
lastRow = lRow + 1
Range("A62:I65").Copy Destination:=Sheets(strTargetSheet).Range("B" & lastRow)
'Copy A62:I65----------------------> target sheet------ at Past in Column B
MsgBox "Copied and pasted at B" & lastRow
VBA code to copy a range and paste at next available row in other sheet
This macro will copy the data from Range A62: I65 in ‘GIS’ sheet to next available row in ‘GIS Comments’
Macro will always check for the next available row and paste the data in the avilable row. This will not over ride the existing data.
Paste some data in GIS at ranges highlighted in Yellow Color. And press the button
Press Alt+F11 to view the macro
Thank you so much it works great. I really appreciate all your help.
You are most welcome Kris! Thanks-PNRao!
What changes would you make to the code if “GIS Comments” is located in another workbook? like C:\Desktop\GIS_Comments.xlsx…
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).