ActiveChart.Location Error
Feb 1, 2008I am writing a macro to place a graph into every worksheet.
I am writing a macro to place a graph into every worksheet.
I'm looking for when 'Chart 1' appears in the code, I would like it to link to the current chart I've just created.
View 4 Replies View RelatedI got the following code:
Code:
ActiveChart.SeriesCollection(11).Format.Line.Visible = True
This works if I click into the chart before running the macro.
However I want that it always runs, also when I'm not inside the chart. How can I replace ActiveChart with Chart&Name of Chart?
Code:
Charts("Chartname").SeriesCollection(11).Format.Line.Visible = True
didn't work.
I have a template excel file that has links to data in another excel file in the same directory as the template. However, I save the template with a new name in a new folder and the link no longer works. The link changes to the location with the new file and of course the file I am trying to like to is not in that location.
The link shows the full path in the template file so I would think it would keep the full path when saving to a new location but the file doesn't.
How do I make the link address static?
Im struggling to get a workbook to a specific location. I have copied 3 worksheets to a new workbook, which im trying to save to an archive folder. Here is my code.
Code:
Sub atest()
Dim strFileName As String
Dim Archivepath As String
[Code]....
The problem is i keep getting an error (runtime 1004) saying the file could not be found?? well, im trying to create it !..
I am trying to export a chart using the code below, the loops change the data that is used to produce the chart:
Dim strFilename As String
Dim strExt As String
Dim lngProfile As Long
Dim lngOption As Long
For lngOption = 1 To 3
Range("nmOption") = Choose(lngOption, "Existing", "Option 4", "Option 5")
For lngProfile = 1 To 4
Range("nmProfile") = "Profile " & lngProfile
ActiveSheet.ChartObjects("Chart 13").Activate
ActiveChart.ChartArea.Select
strExt = "gif"
strFilename = ThisWorkbook.Path & "Images" & _
Range("nmOption") & "_" & Range("nmProfile") & "." & strExt
ActiveChart.Export strFilename, strExt
Next lngProfile
Next lngOption
Each export command creates a file with the correct name but no data (0kb in size) and a temporary file that is the correct file type (I have tried both jpg and gif).
I could try and copy the temporary file, but why does Excel not finish the job? I have tried to put a loop in and also added DoEvents after the export but no joy.
How to get the index number of a seriescollection within the activechart user has selected .
I am able access the chart selected by the user by using the activechart function, but next i am trying to access the seriescollection selected by the user, in other words the activeseriescollection thing.
Is there any way to access the active seriescollection of an activechart or any other way to access the seriescollecion of a chart selected by a user.
I googled a lot but what i found that we have give the index no. i.e; activechart.seriescollection(1)......
Using Excel 2003 and cannot copy a worksheet and am getting this error:
File not found: CDocumentTempVB4B.tmp
I am trying to develop a spreadsheet that will calculate a cost based on a matrix. I am attaching a sample of the calculation created so far. The end result is in cell M13 and is highlighted in yellow. I kind of layed the formula out in a few different cells, so hopefully it would be easy to follow.
simplify this process with maybe another formula that I might not be aware of, or maybe show me how to get this done in VB code. I think VB code would be the correct way to go just not sure.
How do I write a VB Script to take the user back to where they came from.
Example:
User is on Sheet 1 and clicks a macro that takes him to Sheet 10.
I need a macro that is on Sheet 10 that takes the user back to Sheet 1.
BUT if the User is on Sheet 5 and clicks on a macro that take him to Sheet 10
I need that same macro on Sheet 10 to take him back to Sheet 5.
I have a VLookup function setup but I would like another function to tell me where in the table array the value is located.
View 2 Replies View RelatedIs there a way in excel to prevent someone from "re-ordering" tabs in a workbook without using a macro?
I am using a sum formula that goes across multiple tabs, but noted when I rearranged the order of the tabs, that the results of the formula changed. After some minor research, I noted that I had moved a tab outside the "sum range" inadvertently.
If Worksheets(FirstSheet).Cells(Counter, ColtoMove) = MoveIf Then
'i didn't add the THEN PORTION becasue it errors at the above statement.
the problem is that when i go to the defined location (Worksheets(FirstSheet).Cells(Counter, ColtoMove)) it shows the correct/or same PO number as when i put the cursor over the "MoveIF"....this leads me to think that it should not error.
Could it be a correct statement to say how the MoveIf is defined?
I have added a list of all of the potential values that can cycle through this statement.
how these entries could cause a problem in the above code? I am trying to keep it simple (outside of the long list below that is)
PO Number
3840
4247
4260
17467
21012
38125
90495
132284
133291
133453
133840
135496
135816
4500016105
0026974
0027060................
Is there a formula that will return a specified location (column and row) for a text item within a worksheet?
View 9 Replies View RelatedI would like to create a button on a toolbar to save my spreadsheet in 2 locations (always going to be the same, just the file name will change).
View 5 Replies View RelatedI have the following code allowing the user to save a file using a custom macro button. However, I do not want to let them change the name of the file, just the location. How do I do this? ...
View 9 Replies View RelatedA1 cell: 9
A2 cell: 6
A3 cell: 2
A4 cell: 4
i want to know location number of min value in range[A1:A4].
the result: 3
I attempting to develop a forumla to account for 50 locations I am responsible for that will add different numbers together based on a specific location.
For example, if the location says "Los Angeles", I need the formula to look for all instances of "Los Angeles", the quantity of items sold and add them up for me in one spot.
Is there any way to use the offset formula in reference to the location of another cell?
Here is a simplified version of my problem:
Sheet1!A1 refers to Sheet2!A1.
Sheet1!B1 refers to Sheet2!D1.
Sheet1!C1 refers to Sheet2!E1.
Is there any way that I can say that Sheet1!A1=Sheet2!A1 and then use the offset formula based on the location referenced in Sheet1!A1? The cells being referenced are merged cells one column wide and varying rows long, so there is no real pattern to follow except that the corresponding cells (the ones that I want to use the offset formula on) are all taking up the same amount of rows and are an equal amount of columns over (Sheet1!B1 refers to 3 columns over from Sheet2!A1, Sheet1!B1 refers to 4 columns over from Sheet2!A1). The spreadsheet is a fairly complex one and it would be much cleaner and less likely to have any mistakes if I was not referencing each cell individually.
Excel has a function, everytime when I save the file, it will create a backup. how could I specify the location for my backup file?
View 8 Replies View RelatedI have had my server removed that I had my default file location, when I go in to change any of my options the first thing it does is go look for this file location and brings back an error stating it cannot find the server. I cannot find anywhere else that I could change it.
View 9 Replies View RelatedI have received a spread sheet with all the data in column A. It follows the format of A1 = Name, A2 = Email, A3 = Name, A4 = Email, etc. for over 800 entries. What I need to do is etract all the email addresses and place them in column B alongside the Name. I don't have any experience with Makros and tried to use one but kept deleting the wrong data.
View 5 Replies View RelatedAttached I have my document that I am trying to create a search engine for. I want to be able to search for a name within many location tabs. I want to be able to search by name only, bring over the information, and be able to jump to the persons name. If at all possible i would like to be able to search for all that have been billed but not paid.
FluClinicBilling.xlsmFluClinicBilling.xlsm
I followed this guide for a popup calendar
How can adjust this so the calendar popups to the right of the cell thats called it. At present it just pops up in the middle of the screen.
In the attached sheet in module5 I have a save macro with this code
HTML Code:
ActiveWorkbook.SaveAs Filename:="D:Picking Logs" & _
Replace(sFile, "/", "-"), FileFormat:=52
-This saves it to my computers D drive and works fine.
Then I also have the following code whice is suppose to save it to the public drive which is U: drive, but this computer does not have direct access that that drive so i save it to
HTML Code:
ActiveWorkbook.SaveAs Filename:="wcrsan1
owley public1 picking logs" & _
Replace(sFile, "/", "-"), FileFormat:=52
-The wcrsan1 is the path i use to save it to th U:drive.
My issue is the code runs fine, but it does not save it to wcrsan1 owley public1 picking logs. If i save it manually it works but not when the macro runs it.
VBA is password protected.. The password is Kayley98 the sheet password is go
ho.xlsm
Basically I want to have a macro to loop through and make all the pie charts for each location but only for the top 10 of each location.
I also want the legend to be more precise for example, for London the first one in the legend should show:
Column C + "-" + Column I + "-" + Column J
Which would be: London - Rol9 -13
Instead of it being: London data rol9 13
Attached is the document in question where I've made the graphs manually : Example_Pies.xlsx
I have the following code which saves my worksheet with a name extracted from particular cells:
Public Sub SaveAsMaximoWO()
ThisFile = Range("AC5").Value
ThisFile2 = Range("E3").Value
saveName = ThisFile & " - " & ThisFile2
ActiveWorkbook.SaveAs Filename:=saveName
End Sub
This (for reasons I don't understand) saves the file to My Documents by default.
What I would like it to do is save to another folder within my documents as default.
First of all, I would like to thank all Excel Forum Moderators and Members especially Andy Pope for the great effort they exert to help all members.
Lately, I viewed the thread available on the following link and I admired the great perfect work and codes provided by Andy Pope so much,
http://www.excelforum.com/excel-prog...-userform.html
My request is similar to the points discussed in the above mentioned thread, but, it is a little bit different ..
Instead of inserting the picture to the worksheet, I want the picture to be copied from one folder on the HD to another folder called (Employees photos), which is located in workbook's path.
In other words, I need a code to copy one jpg picture from one location to another.
I have the following code, is it possible to direct to a default directory that the file might be in? So when I open the dialog box it will automatically redirect a directory that is stored in VBA.
View 4 Replies View RelatedI had a quick question for something that should be simple but I can't figure it out. I have a column of sorted values, it goes
A
A
A
A
A
B
B
B
B
B
and I want to insert a row to separate the A's from the B's. But there will be a random number of A's. I can figure out how to count where the A's end. But I can't figure out how to insert a row. Any suggestions? I tried the two below but they don't seem to work. The for section is counting the A's, and it works, it's what comes next that's giving me a headache!