Any Way To Show The Workbook Name In A Cell?
Feb 19, 2008is there any way to show the Workbook name in a cell?
i can get it to show using the Footer but i would like it to show in a cell.
ie.
book1.xls
is there any way to show the Workbook name in a cell?
i can get it to show using the Footer but i would like it to show in a cell.
ie.
book1.xls
I have 10 Workbooks open, one primary workbook where the macro resides, and 9 other, randomly named files (workbooks). The macro needs to copy the values from Workbook2,Sheet1, Range("A1") and paste them into the primary file (location irrelevant for now), close Workbook2, then do the same thing for the remaining open workbooks. Is there a "next" workbook function that doesn't need the "name" of the next workbook?
View 2 Replies View RelatedIm trying to get a hyperlink to show up on a different worksheet in the same workbook.
in the orginal cell (in this example L11) i have placed a hyperlink to an external file.
in the cell on the other sheet i have placed
=Sheet1!L11
this shows the text up (in this example : test ) but the link has disappeared.
how i can get the link to show up aswel as the text?
This is the code I received for showing a userform upon open...but it's not working.
View 10 Replies View RelatedI have a workbook that I constantly am improving with new macros and VB routines. I sometimes have two versions available for use at the same time. I would like to create a macro or routine that will tell me if the workbook has been saved. A simple cell color change to indicate I've saved would be fine. Also, if I DO save the file and the cell color changes to indicate I have saved, I would like the cell color to change back if any change is made to the workbook. This way I will always know if I need to save or not to keep latest changes.
View 3 Replies View RelatedI open two spreadsheets only. In one of them I would like the filename of the other spreadsheet shown in cell A1.
The reason why is the filename is a 6 number date and I'd like to confirm it showing in full format.
Is there a way to display the location of an active workbook on my local drive and save it into a varible. I'm new to Excel and VBA but I'm trying to create a template to use for multiple vehicles. When the macro is run...
1) the workbook will have to identify what Workbook and worksheet it is in and save it as a varible so that it can access it later. Each workbook is specific to a vehicle.
*(The reason is because I will need to refer to the address of the original workbook when pasting the copied data from the "OilChart" Workbook.)
2) Copy the vehicle identification # and save as a varible. (Dim vehicleNumber As Variant)
3) Open another workbook on the local drive (OilChart.xls)
4) Run the macro in the new workbook (OilChart.xls) to update the data
5) Search Column B in (OilChart.xls) for matches of the vehicleNumber, and for all rows that match, select and copy all rows and paste it back into the orig workbook (Vehicle Specific Workbook).
This is the code I have so far.
Private Sub btnFind_Click()
Dim vehicleNumber As Variant
Dim sourceLocation As String
Dim sourceFileName As String
Dim fileName As String
Application. ScreenUpdating = False
I have'nt figured out how to do step 5 yet so if anybody has any ideas I'd be open to them. I tried looking at Aaron Bloods Kickbutt VBA Find Function but I got a little lost on how his code would relate to my code. It also looks like it doesn't copy or paste anything to another workbook.
I have a column of data held in column B.
I am required to show the following.
If there is data in the cell then it is to be left. If there is no data in the cell then I would like to show the value 0.
I have tried using a circular reference, using the formula =IF(ISBLANK(B1),0,B1) and other similar formulas but they dont work as the formula overwrites the data in it.
do I need a macro?, or conditional formatting?
I need a code (and where to put it) to open my application excel with only the userform so, with the workbook hidden.
Application.Visible=False doesn't work because it close all excels and moreover I can see the workbook for 1 or 2 seconds before hiding.
A recent message prompted me to complete a project to show all modules and subroutines in a workbook.
As use of VBA to manipulate the VB Editor is a recurring issue I thought it a good idea to share this.
Option Base 1
Dim WBname As String
Dim ws As Worksheet
Dim TitleStr As Variant
Dim VBProject As Object
Dim ToRow As Long
Dim ToCol As Integer
Dim ComponentType
Dim MyComponent As Object
Dim ComponentName As String
Dim TypeArray As Variant
Dim StdCol As Integer
Dim LastLine As Long
Dim CurrentLineNumber As Long
Dim CurrentLineText As String
Sub SHOW_ALL_MODULES()
WBname = ActiveWorkbook.FullName
On Error Resume Next
Set ws = ActiveWorkbook.Worksheets("WB Contents")
If Err.Number 0 Then ' sheet not exist....................
I have a macro that starts when the workbook is open that hides many of the headers and toolbars. It is great and works fine unless you are working on another workbook and need to see those headers and tool bars. Is there a way to display and hide those items per workbook and not for the entire application. here is my failed attempt:
Sub show_excel_headers()
Dim wb As Workbook
Set wb = ThisWorkbook
wb.Application. ScreenUpdating = False
'Display Headings in all worksheets
Dim wsSheet As Worksheet
Dim sSheetStart
Set sSheetStart = ActiveSheet
wb.Application.EnableEvents = False
For Each wsSheet In Worksheets
wsSheet.Activate
ActiveWindow.DisplayHeadings = True
I have a range named "start" and I have a form named "fMenu". I have used this same code in other spreadsheets to have the userform automatically become visible when the spreadsheet is opened and it works in other workbooks. Apparently I have been struck with the stupid stick this morning. I have a hotkey of "M" and when I use control M the form shows up and the macros invoked by each button on the form are working properly.
Sub open_menu()
Application.Goto "start"
fMain.Show
End Sub
Everytime I open a Shared Workbook my OPTIONS get changed and my excel tasks in my start bar and consolidated. Is there a way to prevent that?
As of now I have to keep going through Tools>Options>Show Windows in Taskbar
Macro's aren't allowed in shared workbooks - so what are other options? I would want the same for anyone who opens the file, so a local fix on my machine won't be enough.
is there a way to put a time delay on a pop up box - like show a pop up box for like 2 seconds when the file is opened?
View 9 Replies View RelatedI have created a template with a form. Now I'm using (the code is in ThisWorkbook)
Sub Workbook_Open()
frmMyForm.show
End Sub
This runs the form also when opening the template or a saved workbook based on the template. I want the form to run only when creating a new workbook based on the template. How do I do?
I'm just beginning to work with userforms and have created a couple of forms for workbook navigation. The Menu form is set to appear only on the menu worksheet and the Navbar form is set to show on several database sheets. Both forms are set th hide when the workbook is deactivated.
Private Sub Workbook_Deactivate()
Menufrm.Hide
Navbar.Hide
End Sub
The problem is that when I return to the workbook the forms do not unhide. Using the workbook_activate event causes both forms to show simultaneously. I also have the worksheet_activate event set to show the applicable form.
Private Sub Worksheet_Activate()
Application. ScreenUpdating = False
ActiveWindow.DisplayGridlines = False
Navbar.Show
Navbar.Left = Range("B3").Left
Navbar.Top = Range("B3").Top
Application.ScreenUpdating = True
End Sub
Upon returning to this workbook, I only want the appropriate form to show relative to the worksheet that is active. That is, if I was on sheet2 when I switched to another workbook, sheet2 would be active when I return to the workbook and should show the Navbar form. The menu form should show on sheet1, and the navbar form on sheets 2-5. How do I get the correct form to show when I re-activate the workbook?
I cannot figure out how to get my error handler to work, or actually, not work. It seems to work fine when there is an error, but the code still gets read even when there was not an error. Basically, I am trying to open a file, which may or may not be there. When it is not there I want a message to pop up informing the user. However, when the file is there and it opens, the error handler still gives the message box. Any ideas what I am doing wrong?
Private Sub btnOK_Click()
Application. ScreenUpdating = False
Dim LCSfile As String
LCSfile = frmSelectFile.Listbox1.Value
On Error Goto ErrHandler
Workbooks.Open Filename:=sPath & sDate & "" & LCSfile & "QUANT.CSV"
ErrHandler:
MsgBox ("File is not quantitated. Please select another file.")
Application.ScreenUpdating = True
End Sub
I have 2 different formulas that I need changed in a similar way.
The first formula is for cell AV11:
=SUM(BI11,BP11,BW11,CD11,CK11,CR11,CY11,DF11,DM11,DT11,EA11)+10
Every cell starts off blank.
What I need is for cell AV11 to always start off blank until data is entered into one of the other cells. The problem is that since the sum always needs to be +10 only when data is entered in the other cells, I don't know how to keep 10 from showing in cell AV11 when no data is typed in the other cells.
The other formula is for cell CO39:
=(CU8)+3
I pretty much need the same thing. If no data is entered in cell CU8, then I do not want cell CO39 to show the 3.
I have one worksheet in, which I have to show the accumulated amount found in another worksheet within the same workbook where the value added will be accumulated only when the criteria is met. I have enclosed herewith a sample of what I am trying to do since it is long to explain in writing. As the chinese proverb says: "better see once than hearing/reading 1000 of words.
View 8 Replies View RelatedI have this worksheet with 2 buttons and 2 textboxes.the first button is named search literally to search the items inputted in the textboxes and the second button is clear which clear all the inputted items in the textboxes and the search field. I manage to code those things however I have a main problem. How am I suppose to linked a checkbox with those items?
For example I searched this particular item so the checkbox corresponding to that item must show up in the left most column of it. and if I searched multiple items those checkboxes must show up too. I am having a hard time coding and trying since I am new in vba. I also attached a sample worksheet. I am using excel 2007.
Search.xlsm
Got the roundup part which is ROUNDUP(F2,-3) but having hard time with the other part If the cell (F2) is 0 or below would like to show zero. I am attaching a spreedsheet so you can see what I'm trying to get at.
View 5 Replies View RelatedI have 2 workbooks. 1 is where data is entered called wksPB, the other is like a database workbook. The wksPB has data to be feed from column B to F and there is a dropdown.
what im looking to do is, if the combobox value is selected as Decline then it should display a messagebox that reference value in cell B is denied. if combobox value is Agreed then the macro should search the database workbook for the text entered in column b of wksPB and then copy data of C:E of wksPB to H:J of database sheet where that text is found and also the approver name in wksPB C24 to the approver cell of where that text was found. I've reached till finding the text but what I get my head twiting on is how to copy the text from wksPB column B:F to database sheet column H:K. Im attaching the sample workbooks and the code where ive reached till.
[Code] .....
Attached Files
Replacement Records - 2014.xlsx
forum file.xlsm
On one workbook I have "column A" that lists serial #'s, one serial number per cell. What I need is to be able to take all the non blank data from that column and copy it to another workbook with all those serial #'s in 1 cell numerically sorted and separated by commas.
View 1 Replies View RelatedI'm trying to figure out a way to find a specific sheet in a workbook that does not contain the macro. Within the macro I have a cell which holds the name of the specific sheet I would like to find but I can't get it to work for some reason...
'Dim officen As Integer
'Dim thiswb As Workbook
officen = Range("A2").Value
Set thiswb = ActiveWorkbook
' Open the Active Info file
Workbooks.Open "C:My DcoumentsActive 20080616.xls", , , , "xxxxxx"
' Dim sourcewb As Workbook
Set sourcewb = Workbooks.Open"Active 20080616.xls"
Sheets("officen").Select
RowCount = ActiveSheet.UsedRange.Rows.Count
Range("B2").Select.............................
I have an excel 2003 sheet that collects data from Infopath forms. The forms are to record students who have broken school rules, when, where, repercussions etc. One column shows their class and there is a separate column for each rule broken.
I want to create another sheet to show each class down the rows and the columns to show each school rule. Therefore, each cell would show the number of each particular rule broken for each particular class. I have tried to do countif and sumproduct (if on sheet 1, column B the class is KA and on sheet 1, column M, the rule is bullying = how many times this has occurred).
I need to create an automated process to copy data from book1 and book2 and paste it in another workbook called book3. I want vba code to do this task whenever I open my book3
Book1
Location: G:FUTOMS-phases - eTD and TDReference Infoook1.xls
Data to be copied: Entire Rows 6 to 12
Paste: Book3> Sheet1
Book2
location: H:OptionsInfoook2.xls
Data to be copied:: Entire Rows 1 to 5 & rows 10 to 15
Paste: Book3>Sheet2
Here is the scenario: I have workbook called Leads_2013-0215 it has about 10K records I have workbook called LawFirms it has about 4K records.
If the value in Column I in Leads_2012-0215 is present in column G in LawFirms, I want to add the value Law Firm to column AV in Leads_2012-0215.
I have two workbooks open. I need to "Save As" and close workbook 2 with a file name from a cell in Workbook 1. The macro is running from workbook 1.
I'm guessing a change in the last line. I don't know what Dim means either.
Dim FName As String
Dim FPath As String
FPath = "G:"
FName = Sheets("sheet 1").Range("A1").Text
ThisWorkbook.SaveAs Filename:=FPath & "" & FName
In Cell C4 I have the time 8:00 AM. In Cell D4 I would like to show C4 plus 8 hours.
When I do the simple calculation of:
=C4+8
That doesn't work.
I want a cell to show a number based on a sum of another cell i.e.
50 shows 1
51 shows 2
101 shows 3