OnOpen and OnClose of the spreadsheet, those specific cells will be changed to Text datatype? Something like the following =TEXT(, "DD/MM/YYYY").
My question is can someone help me out with the VBA code that The spreadsheet has a number of date fields/columns formatted as Date (Type:*DD/MM/YYYY, Locale: English (U.K.). I have a spreadsheet that is used as part of a file import process using SSIS and SQL Open the macro, and delete the code we don’t need. Perform the copy and paste value actionsĥ. In the dialog, make the shortcut key as Ctrl + vģ. So we can create a macro to implement the paste value feature and make the macro’s shortcut key as Ctrl + V to “overload” the shortcut key.Ģ.
V), the value and the formatting will be paste. However, by default, when we paste data using shortcut key (Ctrl + When we paste date using right clicking, we can easily choice it from the list. When you paste data into a worksheet, you can choice which type to paste in Paste Special: Paste formulas or Paste value…
do you know how I can ensure that any data which is copied and pasted will always Is how do I write the code to prevent users from copying and pasting data from elsewhere into the workbook that could change the format. Template so that the format of the cells in the range are TEXT, then protect the worksheet so that users are unable to change the format again. But I like the idea that you and Cheng are suggesting, which is to modify the
Thanks in advance for your time and help. But I like the idea that you and Cheng are suggesting, which is to modify the template so that the format of the cells in the range are TEXT, then protect the worksheet so that users are unable to change the format again.Īgain, my only problem with that is how do I write the code to prevent users from copying and pasting data from elsewhere into the workbook that could change the format. If Not (M圜ell.Value = vbNullString) Or M圜ell.Value "" Then Sheets("Sheet1").Unprotect userinterfaceonly:=Trueįor Each M圜ell In Worksheets("Input - Corrections").Range("DateFields3").Cells Currently I have this routine which is called at Workbook_BeforeClose