Detecting If Floppy Disk Is In Drive
Aug 11, 2007
I'm trying to make it so that a backup copy of my file is written to floppy when the file is saved (but not with SaveAs). So far, I have the following code, which if the floppy is in the drive works fine, and doesn't error out if the disk is not in the drive. But it doesn't make sure that a backup copy actually got made. How would I check to see if the disk is in the drive and loop somehow until it was so that the file got saved to floppy?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
On Error Resume Next
Application.DisplayAlerts = False
If Not (SaveAsUI) Then
MsgBox "Please Insert Floppy Disk in Drive A:"
ThisWorkbook.SaveCopyAs "A:" & ThisWorkbook.Name
End If
Application.DisplayAlerts = True
End Sub
View 9 Replies
ADVERTISEMENT
Apr 11, 2008
I have a workbook with a field that contains the users name in cell B1. The first time the user opens the workbook, they put their name in this cell. Is there a way that that name can be saved to disk outside of the workbook in the same directory as the workbook is saved and a formula be put in workbook.open so that it will go get this name variable and insert it in B1 so the user doesn't have to enter their name each time.
I now have them putting their name in and saving the workbook which works until I send out an upgrade. Then they have to type in their name again.
View 9 Replies
View Related
Apr 27, 2007
I have a huge workbook that takes up a lot of memory. The user saves her work every day by saving the entire workbook. Hence, we are using up a lot of hard drive space. I have been trying to find a way to save the relevant worksheets in a format that consumes less disk space. I find that if I save a single worksheet as a web page without the option of interactivity the file is only about 50k. But I need to save three worksheets, not just one. Is there any way to do this? If not, is there any other SAVE AS method that allows one to save three worksheets at a reduced file size? I do not need interactivity, I simply need for the user to be able to go back and view the relevant information in each file.
View 7 Replies
View Related
Mar 4, 2014
Using Excel 2010, I have a workbook containing a variable number of PDF files captured as embedded OLE Objects. I wish to save each of the embedded PDF files to disk and assign the filename based on the contents of column 1 of the row containing the OLE Object.
View 1 Replies
View Related
Apr 15, 2014
Is it risky for someone to edit an excel document while it is still in the flashdisk or external hard disk? I was told that this habit can lead to loss of data or the data can be affected if someone does this. I was told that I have to copy/cut paste the document onto my desktop, edit/ work on it then move it back to the storage device. Is all that work necessary, or can I simply work on the document while it is still in the flashdisk or external hard disk..
View 6 Replies
View Related
Apr 26, 2013
If I want to improve my excel performance like ability to open multiple excel and sheets to perform calculation, should I change to a SSD or a faster intel chip? My current PC sometimes give me a black screen for my excel sheet or is unable to save certain sheets when I open too many sheets.
View 3 Replies
View Related
Feb 5, 2009
Is there a way of detecting, when printing, that a cell is at the top of the page?
I am not talking about the automatic "Rows to repeat at top" option on Page Setup; I have programmatically suppressed repeating information in Column A but I want to repeat that information if the column is fed to a new page.
View 2 Replies
View Related
Mar 11, 2009
Would like to detect same value in 3 cells.
Q 16, R 16, S 16
If there is a same value appearing in two of the three cells.
View 11 Replies
View Related
Mar 15, 2007
I've written a macro to copy data from a series of columns on one sheet and past it on another sheet in a specific way. However, what I really want to do, is write the macro so it automatically detects what the last column is, either by defining a range consisting of the last column, or by writing "Last Column" in one of the cells of the column, and having the macro detect it.
Dim i As Variant
For i = 5 To 56
' What I want to do is have the second number be the last column, instead of 56.
Sheets("MASTER").Select
Selection. AutoFilter Field:=i, Criteria1:=">0", Operator:=xlAnd
Range("Basic_Data").Copy
Sheets(" Consolidate").Select
ActiveSheet.Paste
ActiveCell.Offset(0, 4).Range("A1").Select
Sheets("MASTER").Select...........................
View 5 Replies
View Related
Oct 1, 2006
In my company we have many spreadsheets with sections that contain formulas, which may be overwritten with "hard coding", manually entered constants, in certain situations.
Is there a way I can detect the differences between the two types of cells? I would like to setup conditional formatting that would highlight constants in a table that would generally only contains formulas.
View 14 Replies
View Related
Jun 20, 2014
It worked well at the time and continues to work well.
The problem I have is that I've copied it for use in a new workbook and for some reason it's not picking up email addresses and storing them in the string "stemails", so that when the email is created there are no addressees. Column BA does have email addresses in it however.
[Code] .....
View 2 Replies
View Related
Feb 10, 2012
Using Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) I can execute code when values in the cell change, but it can't check if the foreground or background color changes. What event can detect this? If no event can, is there any way at all?
Found this, I will look into this loop: Capturing cell color change in VBA
View 5 Replies
View Related
Sep 29, 2013
How could I detect if the CTRL (Control) or ALT key has been pressed. I want to execute a macro when either one is press over a given cell.
View 3 Replies
View Related
Dec 1, 2008
A1 : Style 998 45702B WRAP DRESS 1 0 0 0 1
Try to accomplish:
I would like to remove the "1" in between "Dress" and "0"
in other word remove integer from string but starting from right only.
B1 = should contain 1
View 9 Replies
View Related
Dec 22, 2008
I execute custom Insert and Delete macros whenever when the user has selected a single contiguous range of rows to insert or delete.
But I don't know how to detect if the user has selected multiple, non-contiguous rows. Is there a way to detect this situation, and if so, is there a way to "loop" through the individual selections?
View 9 Replies
View Related
Jul 22, 2006
I've been working on a visualizer for large data sets and I'm trying to create a flexible interface. What I am trying to do is populate a sheet with objects(rectangles, triangles, etc.) and linking them all to the same macro. The macro would detect what had clicked it and read the alternative text which would hold the command procedure for that object. I've seen how people detect cursor position but I have not come across anything to detect the object that was clicked. The code I've found (in another post) is as follows:
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Type POINTAPI
x As Long
y As Long
End Type
Sub CurosrXY_Pixels()
Dim lngStatus As Long
Dim typWhere As POINTAPI
lngStatus = GetCursorPos(typWhere)
MsgBox "x: " & typWhere.x & Chr(13) & "y: " & typWhere.y, vbInformation, "Pixels"
End Sub
This works but I can't figure out how to detect the object it clicked. I was hoping to use
ClickedObject = ActiveWindow.rangefrompoint(typeWhere.x, typeWhere.y)
Command = ClickedObject.AlternativeText
but all I get is errors.
View 2 Replies
View Related
Aug 16, 2006
I need to code a procedure which detects when a cell has changed color (I cannot assume where the cell is).
I thought I might be able to use the worksheet_change procedure, but this only 'reacts' when the cell contents change. Can anyone point me in the direction of the right procedure to implement.
View 9 Replies
View Related
Feb 14, 2007
I have a macro tht deletes sheets from my workbook. How do I check if these sheets exist before deleteing them? Thus so that
Worksheets("MySheetName").Delete
Does not generate an error if "MySheetName" doesnt exist?
View 2 Replies
View Related
Mar 20, 2007
I am working on a workbook in which you can click a button on an index page to create a new sheet in the workbook with the name "meeting" and the number meeting that it is. The new sheet is then added to the index page. I am looking for a way to detect when a sheet is deleted so I can update my index page accordingly. I need to be able to know when a meeting is deleted so I can rename all meetings after that meeting and then update my index.
View 7 Replies
View Related
Mar 20, 2007
I want a macro to assess whether there's a page break before column P, if so, remove it and continue, if not... continue.
View 7 Replies
View Related
Jul 7, 2009
I want to enable button on the Menu and Toolbar if User is selected entire row (only one row). If it is selected some Range or more than one Row, the button must be disabled. I'm using this to detect what is the user selection:
View 2 Replies
View Related
Mar 20, 2007
I have created a table with the values of each letter (A = 4, A- = 3.7, B+ = 3.3, through F)
I would like to have a points column which multiplies my letter grade (references a value from the table) by the units the grade is worth.
What function can I use to compare a letter grade with a value I've set.
Example:
Grade: B+
Units: 4
GPA Points Earned: = 3.3 * 4
View 14 Replies
View Related
Mar 22, 2010
I am trying to write a macro to paste the data that has been copied onto the clipboard into my worksheet. However I want to paste it in different ways depending on what data is there.
This is what I have so far:
Sub ImportTissue()
Sheets("Tissue").Select
If "dimensions of clipboard data are 5 cells by 5 cells" Then
Range("E11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
[Code] .........
View 8 Replies
View Related
Apr 13, 2012
How to detect a change in a spreadsheet, but how do i etermine on which cell the change happened?
Basically, I need something like this, if in the range of b1:b30 a cell is changed by the user, let say B??, then change or modify (via a subroutine) cell A??.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'
' detect which cell in the range b1:b30 changed
' then modify the cell to the right (or left) of the changed cell
'
End Sub
View 4 Replies
View Related
Jan 9, 2013
I'm using this piece of code to go through Folders and their Subfolders. It works quite well in going through the first folder and its sub's but does not seem to generate a full list.
I am looking for specific files in these folders, and depending in what folder I place the file, it may or may not detect it. I require the code to go at least 3 levels deep (sometimes more).
FolderName = "C: est folder"
ProcessFiles FolderName, "*.xls"
Code:
'~~> This function was taken from
'~~> http://www.vbaexpress.com/kb/getarticle.php?kb_id=245
Sub ProcessFiles(strFolder As String, strFilePattern As String)
Dim strFileName As String, strFolders() As String
Dim i As Long, iFolderCount As Long
[Code] ......
View 3 Replies
View Related
Apr 10, 2013
I have the following series of formulas consecutively in a single column:
=IF(A3=INDIRECT(ADDRESS(2+MATCH(MIN(H3:H50),H3:H50,0),1)),"YES","NO")
=IF(A4=INDIRECT(ADDRESS(2+MATCH(MIN(H3:H50),H3:H50,0),1)),"YES","NO")
.
.
.
=IF(A50=INDIRECT(ADDRESS(2+MATCH(MIN(H3:H50),H3:H50,0),1)),"YES","NO")
=IF(A51=INDIRECT(ADDRESS(2+MATCH(MIN(H51:H98),H51:H98,0),1)),"YES","NO")
=IF(A52=INDIRECT(ADDRESS(2+MATCH(MIN(H51:H98),H51:H98,0),1)),"YES","NO")
.
.
.
Effectively, I am comparing the values in each set of 47 to determine which one is the smallest. The smallest entry will get a YES label next to it and all others will get a NO. The problem I am having is the the autofill feature is not correctly detecting the pattern, even if I manually fill in the first 49 entries (shown above). If I hilight all of the above entries and autofill one down, I get the following:
=IF(A53=INDIRECT(ADDRESS(2+MATCH(MIN(H53:H100),H53:H100,0),1)),"YES","NO")
It should be:
=IF(A53=INDIRECT(ADDRESS(2+MATCH(MIN(H51:H98),H51:H98,0),1)),"YES","NO")
Basically I need the H:H: reference to stay constant, but only for 47 cells at a time. After that, both the lower and upper bound should increase by 47. Is there any way to indicate this to Excel? Manually typing in the new formula every 47 entries isn't practical because the spreadsheet has thousands of entries. How I can accomplish this using a single formula and autofill?
View 2 Replies
View Related
May 4, 2009
Is there any formula or macro that can be used to detect the value of the last filled in cell in a column or row? For example, I fill in column B each day with a new numerical variable, so on day one B1 = 100, on day 2 B2 = 200, on day 3 B3 = 150 and so on. I would like the last variable entered in column B to appear in, for example, cell A1. Is there any way to do that?
View 9 Replies
View Related
Feb 5, 2014
I have a sheet containing lots of information (lists of flight information to and from all countries). So entries are duplicated in the entire sheet. For example LITHUANIA, USA, CHINA... appears lots of times. I only need to highlight particular countries.
I would just use conditional formatting, but maybe there is a quicker way to do that?
So there is a list of 50 countries in one sheet and in another sheet I got all the info. I need those 50 countries from the list to be highlighted in the info sheet (sheet has many columns and rows).
View 6 Replies
View Related
Oct 21, 2011
Is there a way to detect a change of pages in a Multipage form, i.e. is there a change event that is triggered when a user goes from page 1 to page 2? If there is, what does the code look like?
View 5 Replies
View Related
May 30, 2013
I need to detect when some Chart is being deleted. This is part of an XL2010 VSTO addin I an developping. I could not find any event matching my need.
Did I miss some event somewhere? Would you know a (simple) method to detect when some Chart is being deleted by the user?
View 1 Replies
View Related