Another approach using dictionary [code] Private Sub UserForm_Initialize() Dim arr As Variant arr = GetDistinct(Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)) ListBox1.List =...
Thanks a lot PNRao for this great solution Another approach using collection [code] Private Sub UserForm_Initialize() Dim ws As Worksheet...
Thanks vaali... this is the data sheet1 data EID NAME PAY PayDay 14123 Joe1 $1,234.00 29-Jun-17 14124 Joe2...
HI, Here is the required macro to search a field and if value found copy the whole row into another...
I found a solution like this :Records in between two specific dates easily can be filtered using drop-down lists ....
I found a solution as follows: Watch the video to see how it's done and download example file : https://youtu.be/SZduAoOtiS0
I have sorted the above problem. Code is given below... [code] Sub seperate() Call CleanSheets MsgBox "1 of 10 Cleaning...
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).