Related:
- Transfer data from sheet1 to sheet2
- Free fire transfer - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Tmobile data check - Guide
- Gta 5 data download for pc - Download - Action and adventure
- Ssh secure file transfer client download - Download - Remote access
2 responses
Try this:
Place that just before the End Sub.
As for not moving the end cells, you may need to record that value into a variable, then place that variable back down into the cell you wish to have it, after all of the deletes. As a deleted cell needs to go away, or you will just be deleting the contents, and therefor not accomplishing anything!
ThisWorkbook.Worksheets("Sheet2").Activate
LastRow = Sheet2.Cells(Sheet1.Rows.Count, "A").End(xlUp).Row
Range("A2", "A" & LastRow).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlUp
Place that just before the End Sub.
As for not moving the end cells, you may need to record that value into a variable, then place that variable back down into the cell you wish to have it, after all of the deletes. As a deleted cell needs to go away, or you will just be deleting the contents, and therefor not accomplishing anything!
i do this code and give me the error run-time 1004 application- defined or object defined error
Sub save()
Dim ss As Range
Set ss = Worksheets("sheet2").Range("a75:a88")
ThisWorkbook.Worksheets("sheet2").Activate
LastRow = sheet2.Cells(sheet1.Rows.Count, "A").End(xlUp).Row
Range("A2", "A" & LastRow).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlUp
End Sub
Sub save()
Dim ss As Range
Set ss = Worksheets("sheet2").Range("a75:a88")
ThisWorkbook.Worksheets("sheet2").Activate
LastRow = sheet2.Cells(sheet1.Rows.Count, "A").End(xlUp).Row
Range("A2", "A" & LastRow).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlUp
End Sub
If you press, DEBUG, it will highlight the line it is stopped on.....and the error says what is wrong.......
So do you have blank items items in the Cells of the range that is highlighted? If not, it will throw an error!
If you are definingg the range with hard code, then you do not need to find the last row, as you are already defining it!
This will still throw 1004 error, but it is what you were attempting (I think!).
You are defining a sheet, but not doing anything with it! You never reference SS again! So I am confused as to why it is even there.....
So do you have blank items items in the Cells of the range that is highlighted? If not, it will throw an error!
If you are definingg the range with hard code, then you do not need to find the last row, as you are already defining it!
This will still throw 1004 error, but it is what you were attempting (I think!).
Sub save()
ThisWorkbook.Worksheets("sheet2").Activate
Range("a75:a88").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlUp
End Sub
You are defining a sheet, but not doing anything with it! You never reference SS again! So I am confused as to why it is even there.....
abdelfatah_0230
Posts
73
Registration date
Thursday July 18, 2019
Status
Member
Last seen
July 23, 2022
Jul 26, 2019 at 05:22 PM
Jul 26, 2019 at 05:22 PM
i know how i can find the error in line but the window what shows is not like your picture thats why it doesn't allow me where the exact the errors and still continue the error and i change the code to help me where is the error and correct me because i'm newer in vba
OK. Are there values in the cells that are highlighted? I can duplicate the error when there are no duplicates within the range that happens to be selected. It is just the return of NO DUPLICATES. Do this:
1. clear the sheet that you are copying to.
2. Make the sheet that you want to transfer have focus
3. Press RUN.
4. post the feedback (as I only get this error, after I have ALREADY REMOVED the DUPLICATES)
1. clear the sheet that you are copying to.
2. Make the sheet that you want to transfer have focus
3. Press RUN.
4. post the feedback (as I only get this error, after I have ALREADY REMOVED the DUPLICATES)