You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
direct setting of CUD Mark ranges (intersecting with existing: u, non-intersecting: i), also now check whether target range was enhanced (rows inserted) or reduced (rows deleted) and set CUD Marks logically.
UserMsg("Whole column deleted, it is recommended to immediately close the DBSheet Workbook to avoid destroying the DBSheet!","Set CUD Flags for DB Mapper")
520
+
UserMsg("Whole column deleted, it is recommended to immediately close the DBSheet Workbook without saving to avoid destroying the DBSheet!","Set CUD Flags for DB Mapper")
521
521
ExitSub
522
522
EndIf
523
523
' sanity check for whole range change (this happens when the table is auto-filled down by dragging while being INSIDE the table)..
524
-
' in this case excel extends the change to the whole table and additionally the dragged area...
' in this case excel extends the change to the whole table and additionally the dragged area...Additionally check if the table was not reduced by deletions as that also leads to targetRangeRows <= changedRangeRows
DimretvalAsMsgBoxResult=QuestionMsg("Change affects whole DB Mapper Range, this might lead to erroneous behaviour, really set CUD Flags ?",,"Set CUD Flags for DB Mapper")
527
527
Ifretval=vbCancelThenExitSub
528
528
EndIf
@@ -535,8 +535,9 @@ Public Class DBMapper : Inherits DBModif
535
535
EndIf
536
536
537
537
preventChangeWhileFetching=True
538
-
' All cells in DBMapper are relative to the start of TargetRange (incl a header row), so CUDMarkRow = changedRange.Row - TargetRange.Row + 1 ...
538
+
539
539
Try
540
+
' Ctrl Shift - pressed: set delete flag and visual marker in selection
540
541
IfdeleteFlagThen
541
542
DimcountRowAsInteger=1
542
543
ExcelDnaUtil.Application.AutoCorrect.AutoExpandListRange=False' to prevent automatic creation of new column
@@ -550,85 +551,81 @@ Public Class DBMapper : Inherits DBModif
UserMsg("Data was deleted with Ctrl & -, in case of existing data this will not be deleted in the database (use Ctrl-Shift-D instead, refresh the DB-Sheet now to retrieve the missing data again)","Set CUD Flags for DB Mapper",MsgBoxStyle.Exclamation)
' single row change: set insertFlag if all (other not entered) cells are empty
554
567
IfchangedRangeRows=1Then
555
-
' shows that row was deleted
556
-
IfpreviousCUDLength>TargetRange.Rows.CountThen
557
-
DimretvalAsMsgBoxResult=QuestionMsg("A whole row was deleted with Ctrl & -, the row will not be deleted in the database (use Ctrl-Shift-D instead, click cancel and refresh the DB-Sheet with Ctrl-Shift-R now)",,"Set CUD Flags for DB Mapper",MsgBoxStyle.Exclamation)
DimretvalAsMsgBoxResult=QuestionMsg("A whole row was modified, in case you deleted a row with Ctrl & -, the row will not deleted in the database (use Ctrl-Shift-D instead, click cancel and refresh the DB-Sheet with Ctrl-Shift-R now)."+vbCrLf+"If you inserted a row, confirm the insertion by continuing now.",,"Set CUD Flags for DB Mapper",MsgBoxStyle.Exclamation)
DimretvalAsMsgBoxResult=QuestionMsg("A data range was pasted above the data area of the DBSheet, this renders the DBSheet disfunctional. Immediately refresh the DBSheet to regain functionality",,"Set CUD Flags for DB Mapper",MsgBoxStyle.Exclamation)
607
-
GoToexitSub
608
-
EndIf
609
-
' copy/paste of large ranges needs quicker setting of u/i, only do if no CUD flags already set (all CUD cells are empty)
610
-
' can't use ExcelDnaUtil.Application.WorksheetFunction.CountIfs(changedRange.Columns(targetRangeColumns + 1), "<>") = 0 here as it clears the flags as a side effect..
UserMsg("A data range was pasted above the data area of the DBSheet, this renders the DBSheet disfunctional. Immediately refresh the DBSheet to regain functionality","Set CUD Flags for DB Mapper")
603
+
GoToexitSub
604
+
EndIf
605
+
' copy/paste of large ranges needs quicker setting of u/i, only do if no CUD flags already set (all CUD cells are empty)
606
+
' can't use ExcelDnaUtil.Application.WorksheetFunction.CountIfs(changedRange.Columns(targetRangeColumns + 1), "<>") = 0 here as it clears the flags as a side effect..
<Assembly:AssemblyDescription("DBAddin is a ExcelDNA based add-in for database interoperability (functions for database querying and methods to manipulate data in database tables are provided).")>
0 commit comments