excel-2013

What Excel formula returns the sheet name?

我的梦境 提交于 2019-11-30 18:19:19
I have searched the excel function documentation and general MSDN search but have been unable to find a way to return the sheet name without VBA. Is there a way to get the sheet name in an excel formula without needing to resort to VBA? Not very good with excel, but I found these here =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256) and A1 can be any non-error cell in the sheet. For the full path and name of the sheet, use =CELL("filename",A1) Orbit For recent versions of Excel, the formula syntax is: =MID(CELL("filename";A1);FIND("]";CELL("filename";A1))+1;255) ADrunkenMan The

Excel Custom Task Pane not showing

允我心安 提交于 2019-11-30 15:09:55
I'm showing a custom task pane in an excel VSTO add-in, I'm building it and showing it as thus: var ctrl = new CellTaskPane(); var pane = CustomTaskPanes.Add(ctrl, "Custom Sheet"); pane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight; pane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange; pane.Visible = true; This is being done in the ThisAddin.cs file and it working just fine on my machine, both under a Debug session and with the add-in installed via the click-once installer. However, installing the add-in on a colleague's machine is

What's the RIGHT way to reference named cells in Excel 2013 VBA? (I know I'm messing this up)

孤街浪徒 提交于 2019-11-30 07:22:57
问题 I have a cell (Ok there's a bunch but I'm just looking at one now) named "Classes". It's "C10" by Excel's grid notation. My code works perfectly when I reference the cell as Range("C10") = "Value" But when I use Classes = "Value" It just does nothing. So, what's the correct way to reference a named cell by its name? 回答1: You replace the address with the named range's name: Range("Classes") = "Value" 回答2: You can use the square bracket shorthand for referencing ranges: [Classes] = "Value" So

PivotCaches.Add Errors out

一个人想着一个人 提交于 2019-11-29 18:06:08
I'm using excel 2013 and I am getting invalid procedure call or argument while calling PivotCaches.Add Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True Set ActiveWorkbook = objExcel.Workbooks.Open("C:\Users\srujan\Desktop\TIME REPORT\fresh\25_Report Time Booking_25.xls") ActiveWorkbook.Sheets("25_Report Time Booking_25").Select ' Set the range to be pivoted to be called PivotRange Set PivotTopLeft = ActiveWorkbook.Parent.Worksheets("25_Report Time Booking_25").Range("A1") Set PivotTopRight = PivotTopLeft.Range("G1") Set PivotTop = ActiveWorkbook.Parent.Worksheets("25

What Excel formula returns the sheet name?

为君一笑 提交于 2019-11-29 17:38:39
问题 I have searched the excel function documentation and general MSDN search but have been unable to find a way to return the sheet name without VBA. Is there a way to get the sheet name in an excel formula without needing to resort to VBA? 回答1: Not very good with excel, but I found these here =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256) and A1 can be any non-error cell in the sheet. For the full path and name of the sheet, use =CELL("filename",A1) 回答2: For recent versions of

How to find max and min date in a range of another sheet?

喜夏-厌秋 提交于 2019-11-29 11:27:46
I am writing VBA code to find the minimum and maximum dates in a Range. When I execute it, I get an error: Run-time error '1004': Application-defined or object-oriented error. Below is my code: Sub GenerateSheet() Dim i, r, numAssignments As Integer Dim ssrRng, DestRange As Range Dim StartDate, EndDate, d As Date numAssignments = Sheets("Data").Range("A1048576").End(xlUp).Row - 1 Sheets("Schedule").Select EndDate = WorksheetFunction.Max(Sheets("Data").Range(Cells(2, 8), Cells(numAssignments, 8))) StartDate = WorksheetFunction.Min(Sheets("Data").Range(Cells(2, 5), Cells(numAssignments, 5))) End

Excel 2013 VBA Error

坚强是说给别人听的谎言 提交于 2019-11-29 07:13:49
I am getting following error. Compile error: The code in this project must be updated for use on 64-bit systems. VBA CODE Option Explicit Private Declare Function URLDownloadToFile Lib "urlmon" _ Alias "URLDownloadToFileA" (ByVal pCaller As Long, _ ByVal szURL As String, ByVal szFileName As String, _ ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long Dim Ret As Long '~~> This is where the images will be saved. Change as applicable Const FolderName As String = "C:\Temp\" It works fine in Excel 2010. Thanks. EDIT Error I get is Ret Variable Not defined . Here's the rest of the code. Sub

Is Excel VBA's Rnd() really this bad?

让人想犯罪 __ 提交于 2019-11-29 03:42:59
I need a pseudo random number generator for 2D Monte Carlo simulation that doesn't have the characteristic hyperplanes that you get with simple LCGs. I tested the random number generator Rnd() in Excel 2013 using the following code (takes about 5 secs to run): Sub ZoomRNG() Randomize For i = 1 To 1000 Found = False Do x = Rnd() ' 2 random numbers between 0.0 and 1.0 y = Rnd() If ((x > 0.5) And (x < 0.51)) Then If ((y > 0.5) And (y < 0.51)) Then ' Write if both x & y in a narrow range Cells(i, 1) = i Cells(i, 2) = x Cells(i, 3) = y Found = True End If End If Loop While (Not Found) Next i End

Check if cell contains Non-Alpha characters in Excel

故事扮演 提交于 2019-11-29 03:32:44
Is there a Non-VBA way to check Col B and Col C to see if they contains any characters that are Non-Alpha? Just to clarify by Non-Alpha I mean anything not part of the alphabet(case insensitive). Col B and Col C is a list of First and Last Names. Some of these names have symbols or numbers in them through bad data entry. I am trying to find all the ones that need to be fixed. So I need to find the ones that contain ANYTHING that is not a letter. Roobie Nuby There is a "weird" but simple and generic answer. =SUMPRODUCT(SEARCH(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"abcdefghijklmnopqrstuvwxyz"))

What's the RIGHT way to reference named cells in Excel 2013 VBA? (I know I'm messing this up)

六眼飞鱼酱① 提交于 2019-11-29 03:11:17
I have a cell (Ok there's a bunch but I'm just looking at one now) named "Classes". It's "C10" by Excel's grid notation. My code works perfectly when I reference the cell as Range("C10") = "Value" But when I use Classes = "Value" It just does nothing. So, what's the correct way to reference a named cell by its name? You replace the address with the named range's name: Range("Classes") = "Value" You can use the square bracket shorthand for referencing ranges: [Classes] = "Value" So you can save on Range and "" , and it also looks better (square brackets look a bit like a cell). You can also use