ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy a record before deleting (https://www.excelbanter.com/excel-programming/352493-re-copy-record-before-deleting.html)

Shinu

Copy a record before deleting
 

Dear sir,
When program reaches the below given code
--------------------------------
ans = MsgBox("Delete Record?", _
"Delete this record?", vbYesNo)
---------------------

it gives error showing "Run time error -'13' Type mismatch. Could yo
pls. look into this matter

Thanks
Shin

--
ShinuPosted from - http://www.officehelp.i


Shinu[_2_]

Copy a record before deleting
 

Dear sir,
Now when the program reached to the following code starting with set
-------------------------------------
With Sheets("DeletedRecords")
Set rng2 = .Range("A1").End(xlDown) _
.Offset(1, 0)
End With
--------------------------------
it shows Run time error '1004' Application defined or Object define
erro

--
ShinuPosted from - http://www.officehelp.i


Tim Williams

Copy a record before deleting
 
Missing a period after (xlDown)

With Sheets("DeletedRecords")
Set rng2 = .Range("A1").End(xlDown).Offset(1, 0)
End With

You might want to be careful with that approach: it will fail for cases
where the xlDown takes you to the last row and then you try to offset one
more row... Working from the bottom up is usually safer.

Tim



"Shinu" wrote in message
...

Dear sir,
Now when the program reached to the following code starting with set
-------------------------------------
With Sheets("DeletedRecords")
Set rng2 = .Range("A1").End(xlDown) _
Offset(1, 0)
End With
--------------------------------
it shows Run time error '1004' Application defined or Object defined
error


--
ShinuPosted from - http://www.officehelp.in




Shinu[_3_]

Copy a record before deleting
 

Thanks for the help
Shin

--
Shin
Posted from - http://www.officehelp.i



All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com