Path not found, but the folders do exist
[code] Sub toPDF() ' This will copy a specified range('s) from ws1 & ws2 to ws3. ' Now you can...
I believe the problem is that you are not getting the sFileName from the original workbook. So I have added ActiveWorkbook.Save...
Hello Ready2go This may only answer some of your question. The macro below will create a PDF file of Sheet2....
Dear Hyside2, I really appreciate your cooperation and helpful answer. Thanks so much.
Try this instead =IFERROR(LEFT(B1,FIND(" ",B1)-1),B1) [img alt_text='' description='']http://vbaf1.com/q/wp-content/uploads/2018/08/givenname.png[/img]
I am not sure if this is what you are looking for but test it out anyway. [img alt_text='' description='']http://vbaf1.com/q/wp-content/uploads/2018/08/1-2.png[/img]...
Oh! Please try this. You will need to change "Book1" on the line that reads (oFilename="Book1") to the name of...
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).