2020. 2. 23. 01:43ㆍ카테고리 없음
All.I've stolen this code from here.Code:Private Sub WorkbookOpenDim response As VbMsgBoxResultresponse = MsgBox('Update reference number?' , vbYesNo + vbQuestion)If response = vbYes ThenWith Sheets('Sheet1').Range('A1').Value =.Value + 1End WithEnd IfEnd Subthis is the often asked invoice increment type question. But i'd like to add to it.if the user saves the workbook as a different name. The workbook changes from being the template to being a fixed record of the order/invoice that was raised how can this 'Update reference' Msg box be stopped?.I need a robust system that will stop the possibiltiy of the audit trail being lost.I'm thinking auto save as a different name? But i'm not sure what the other options are?ALSO as an challenge the original template will need to be a shared workbook - a number of people in the team use it - how on earth would this work?So i want a number of people to be able to use the shared workbook, and it increment by one, but without the possibility of two having the same number. Would an open event work in this case. Or does the shared status prevent this?Help appreciated, as always.
I have never really used VBA and so am completely stuck at this problem. I need to create a macro which auto-populates a master worksheet from the individual user sheets in a shared workbook.Sheet 1 is the master sheet 'Team Stats'. There will be an undetermined number of individual worksheets to accomodate new staff.Each worksheet will be identical, using columns A-I with row 1 having the headings:Date, Name, Reference, Value, Price, Age, Purchased?, Destination, Add. Products (the last 3 columns will have a drop-down list which will be used to enter data into the cell).There will be a varying number of rows in each of the individual sheets.If possible I would like the macro to run every time data is entered into one of the individual worksheets. If this is not then it would be fien to update every time the workbook is opened.If anyone can help it would really cut down the time I spend collating these stats every day!
Hello everyone!!!!Here is my situation. I have been trying to learn macros but have not made one yet. Need your help. Here at work, I have some incompentant computer workers who claim they KNOW MS sooo well and have certificates etc.COUGH COUGH. ya ok. LMAOWe have a 'shared' work book we all work in. It's nothing fancy, just use it as a PO Book but since it is shared some people continue to not save before they add in more work so that they see a 'refreshed' copy of the workbook before they start writing in cells that already contain information.How to I create a macro button at the top of the page that is literally a SAVE button.
Instead of them saving by going to File - Save or cntrl+s??? I just thought that MAYBE having a big button in their face will remind them.Secondly as back up I was wondering if you can create a macro to do a refresh of everyones screens automatically - say every 2 or 5 mins??? I don't mean a save. But a refresh so the screen actually updates in front of you. (although I will keep this little piece of magic out of their knowledge so they don't rely on it, just though it would be a secondary back up to helping eliminate these mishaps cause we are loosing alot of information by people saving overtop of other peoples work and not caring.)Thanks so much!!!!! Muchly appriciated. Is it possible to share a workbook with macros and have the macros work properly.
I have one spreadsheet that needs to be shared by many users. We want to all be in the same document at the same time saving changes. The real catch is that the workbook has macros. I used the 'Share Workbook' function under tools.
At the end of the setup, it told me that the macros would not work properly. The odd thing is that everytime I try to click on one of the macros I get an error, but yet the macro still performs the function. So essentially the macro works, it is just a pain because you have to click 'end' everytime on the error screen. Any suggestions?Alanda. Hi all,The following code is placed in workbook 'A' and is used to open workbook 'B'. These workbooks will now always be housed in the same directory and i want to change the code to use a relative path reference by determining the path of workbook 'A'. Here's what I had:Sub incomestatementApplication.WindowState = xlMaximizedApplication.Workbooks.Open 'C:Documents and Settings.workbook B.xls', UpdateLinks:=xlUpdateLinksAlwaysEnd Subcould you suggest how to change this to use a relative path reference?
I have a VBMacro Excel file loaded on a Server that numerous people access. A Macro in this file creates a Copy of a specific Sheet within the Active Workbook and I want to Save it to the individual's Desktop.How do I find out what the current User's desktop folder path is each time the Marco is run by a different User?Example User's path: 'C:Documents and SettingsjfarcDesktop'Where 'jfarc' is the name of the current User which, will of course change with every different User that runs the Macro.Also, is there a way to pull out of Excel what is the current User's 'Options General Default File Location' entry? Which may differ from the above directory.I am familiar with and use the following coding for Opening/Saving files to the current directory of the opened workbook, but it only gives the path of the existing Excel workbook and not the current User's Directory Path:Dim wbThis As WorkbookSet wbThis = ThisWorkbookChDir wbThis.Path. I have workbook in which I want to save a specific worksheet to a new file with only the values saved - all data in this worksheet are references to cells on another worksheet, which is using VLOOKUP to pull data from a database.Found the following code and it gets me close, but it copies the cell references, not the values. It also allows me to specify the file name from a cell reference.I want the new workbook file to simply be saved, not opened, and a message box to display stating where the file was saved (will always be in the same location on the LAN).What modifications do I make to this to get this to work per above requirements?Sub CopyMeDim SaveMeAs As StringSaveMeAs = Sheets('Sheet1').Range('B2').TextSheets('Sheet3').CopyActiveWorkbook.SaveAs Filename:='C:My Documents' & SaveMeAsEnd Sub. Hi all.I have set up a workbook that is sent out to lots of different users. Hello,I have a number of different files that I often need to run a macro on.
Hi, I'm trying to get some macros to combine data from two open workbooks, and I can't figure out the commands to switch from the active workbook to the other open workbook and back. I'm new to VBA and just learning the ropes. All I can figure out is how to switch to another workbook with an exact name. If I record the macro to go to a recent file, for example Window 1 (filename), the code that I get in VBA is Windows('filename').Activate. This doesn't translate to when I have two different workbooks with different filenames open.Make sense? I'm a bit confused myself. Maybe just a list of basic workbook-switching techniques or commands would be useful.- Michael.
I know this question has been asked a bajillion times, so I apologize for the redundancy.I am working with an Excel spreadsheet and saving it as a.csv file in order to upload to an application that parses out the.csv data as transactions. The system requires.csv files, so this is how I need to save my doc (with this extension). I have been successful at preventing Excel from coverting that long number into scientific format. I have saved as a TXT file, pasted the longer number and it displays correctly. That is all good. But I have to save as a.csv. So if I do that, close the Excel window, and then open again (as the.csv file), the numbers are back to being displayed in scientific format.
File Name Too Long To Delete
I have tried creating an Excel doc from scratch and entering text in Text format, to see if this created a cleaner file. But again, the second I save as.csv, close the window and then open that file up again, that dang scientific format is back.Does anyone have any idea of how to work around this? Once I have successfully gotten the numbers to display as the long-chain number, how can I get them to 'stick' so that they don't revert back to scientific format when I reopen the file?Thanks so much for your help! Hello,i've got the following problem:I want users to double-click on a row on a protected sheet and then do some code based on the row-number of the clicked cell. I've protected the sheet because it contains a lot of formula's.When a user double-clicks a row it triggers the code through the WorkbookSheetBeforeDoubleClick event.After the code is executed Excel shows a message that the cell that was clicked was protected etc etc.How can I prevent this message from popping up?I've already triedCode:application.displaywarnings = falsebut that didn't workThanks. I'm having a problem in a workbook with several ActiveX command buttons. I had been using the form control buttons to run macros, but the boss wanted each button to have it's own, different color.
So I removed the form control buttons and created new ActiveX command buttons. I got into the button properties and set the background colors. I added the Click code to run the macros when the user clicked the buttons.All of the buttons were working fine. Then I saved and closed the workbook and went to lunch. Now when I open the workbook, the buttons don't work!
When I click them nothing happens. They appear frozen. They don't even seem to click. No error message.
Nothing.If I right-click the button in Design Mode and select Properties, I get sheet properties not the button properties. I can't seem to locate the command button properties any longer. I still see the button name 'cmdButtonGetInfo' and '=EMBED('Forms.CommandButton.1',') in the name box and formula bar.
The odd thing is if I create a new button it works fine until I save and close the file. When I reopen the file none of the buttons work.It's like the buttons are being disabled when I close or open the file. Any suggestions? I have a Workbook with 2 sheets, the first one is the data entry and the second one contains all the calculations and confidential info.I have one staff member that does the data entry but I don't want them to see the 2nd sheet.
I know I can hide the sheet then protect the entire workbook which does work, but is there an easier way so that the second person doesn't have to keep hiding/unhiding the 2nd sheet?It would be perfect if when you tried to click on Sheet2, it asked for a password.CheersJase. HelloI'm quite experienced Excel user. I've never come across this problem but tinkering in every conceivable way within Excel settings and the solution has eluded me.I have added a worksheet created elsewhere (it is a form I need printing, with the data coming from 2 sheets I have created from scratch) which has pre formatted cells for Date and Client Name etc.When I try to reference the cell in this added sheet from my 2 sheets, instead of the result, it always displays the formula, not the result.I have tried doing it from one of my sheets to reference to this new, and that displays the result and not formula. I can't imagine why it's doing this and I've never seen it happen before.Formatting cells, giving cells names rather than the usually adequate of reference to the Cell Number doesn't change things.
I wonder if I've picked up some legacy protection from the original form but can't see anywhere in the tools etc that's obvious.There's about 50+ cells that need referencing and I got to get this done for work.Please help me. This is my first need to post on a Excel Forum as I've always found help or answers from other peeps or internet but this one is making me scratch my head big time. I am using the code below to disable the save function very successafully. However, is there a work around to allow a macro to save?-Private Sub WorkbookBeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)'this disables the save function on the XLSMsgBox '.Save is Disabled.' Following line will prevent all savingCancel = True' Following line will prevent the Save As Dialog box from showingIf SaveAsUI Then SaveAsUI = FalseEnd Sub.
I saw two threads in this forum that asked this question, with no good answer. I am posting this solution for anybody still struggling with this.The question:How can you prevent a cell's contents from overflowing into the next cell?Of course, you can make the column wider or turn on text wrapping, but you might not want to. Each of those solutions can mess up the layout of your sheet. You may just want to truncate the value.Some people have suggested putting a space in the next cell.
This is unnecessary, a pain in the but, and will mess up any ISBLANK type formulas, among other things.The solution:Select the cells in question and turn on text wrapping (FormatCellsAlignmentWrap Text).Now select the row(s) in question and manually set the row height, by right clicking the row number and selecting 'Row Height'. Check the height of an adjacent row for a good value.Your cells will now not spill over either horizontally or vertically. They will simply truncate anything that doesn't fit.Be careful now, because parts of your data may be hidden.
This can cause its own set of problems if one or two digits are neatly hidden away. Think ahead if other people might be using this sheet, and not be expecting to have some data hidden.Tested in Excel 2002. Hello,As the title goes this is as simple as it gets. The macro worked good when I was using excel 2003 but now that I have 2007 everything works for except the resizing (Picture.Width & Picture. I have a workbook that has compliance dates in columns 'F','G' and 'H' from row 7.
What I need is when the date in either column comes within 30 days to auto send an email, address in column 'A', recipients name in column 'B'. And then place todays date in column 'P'. ALso need to send a follow up email when either date comes within 7days and then place todays date in column 'Q'.
If there is a date in column 'P' then don't send email. If there is a date in column 'Q' then don't send follow up. Can this be done without the users intervention and each time the workbook is opened.Thanks in advance for any assistance.Mick.
Code: Private Sub WorkbookOpenDim response As VbMsgBoxResultresponse = MsgBox('Update reference number?' , vbYesNo + vbQuestion)If response = vbYes ThenWith Sheets('Sheet1').Range('A1').Value =.Value + 1End WithEnd IfEnd Subthis is the often asked invoice increment type question. But i'd like to add to it.if the user saves the workbook as a different name. The workbook changes from being the template to being a fixed record of the order/invoice that was raised how can this 'Update reference' Msg box be stopped?.I need a robust system that will stop the possibiltiy of the audit trail being lost.I'm thinking auto save as a different name? But i'm not sure what the other options are?ALSO as an challenge the original template will need to be a shared workbook - a number of people in the team use it - how on earth would this work?So i want a number of people to be able to use the shared workbook, and it increment by one, but without the possibility of two having the same number. Would an open event work in this case.
Or does the shared status prevent this?Help appreciated, as always. (30 responses) i copied numbers from an online account. Pasted them into excel 2002. How do i convert the numbers to numbers i can multiply etc? I tried pu.(10 responses) I have a spreadsheet with data from a survey: 9 questions, each with an answer between 1 and 5. I have a pivot table that shows me a breakdo.(16 responses) I have a ComboBox that I am trying to get the BackColor to change based on a selection.
There are 11 ComboBoxes on the sheet. After I have g.(11 responses) I am trying to save excel worksheet to PDF however encountering runtime error 1004 with the msg with reads as 'Document not saved. The.(8 responses) I need to convert a number, which will be of indeterminate length, into a text string of fixed length. The length is 14 characters long.
To f.The Holy Grail of Excel Tips $12.60.