excel-2003

How to show current user name in a cell?

a 夏天 提交于 2019-12-31 13:43:43
问题 In most of the online resource I can find usually show me how to retrieve this information in VBA. Is there any direct way to get this information in a cell? For example as simple as =ENVIRON('User') (which did not work) 回答1: Based on the instructions at the link below, do the following. In VBA insert a new module and paste in this code: Public Function UserName() UserName = Environ$("UserName") End Function Call the function using the formula: =Username() Based on instructions at: https:/

Missing values in MS Excel LINEST, TREND, LOGEST and GROWTH functions

删除回忆录丶 提交于 2019-12-31 01:47:16
问题 I'm using the GROWTH (or LINEST or TREND or LOGEST, all make the same trouble) function in Excel 2003. But there is a problem that if some data is missing, the function refuses to give result: You can download the file here. Is there any workaround? Looking for easy and elegant solution. I don't want the obvious workaround of getting rid of the missing value - that would mean to delete the column and that would also damage the graph, and it would make problems in my other tables where I have

Incorrect value when counting cells in different versions of Excel

谁说胖子不能爱 提交于 2019-12-30 22:27:35
问题 I have seen some SO users run into an issue when trying to use some variation of Cells.Count ; the VBA code throws an overflow error in some cases. For reference, see comments on this answer: I think this will work, but I get an "overflow" error and it points me to the code "If Master.Cells.SpecialCells(xlCellTypeVisible).Count > 0 Then" --- it seems like it's not filtering for anything in particular – user1556069 and this answer: Is this onyl working (and Cells.Count didnt work) because the

Can I Get the Source Range Of Excel Clipboard Data?

二次信任 提交于 2019-12-29 08:45:08
问题 If the Clipboard contains an Excel Worksheet Range, you can access that Range's Data with the DataObject Object Can you also find the actual Source Range (ie Worksheet, Row & Column) of that Data? Alternatively, can you find the Last Copied Range, which is indicated with a Dashed Outline Border ( NOT the Selected Range)? Preferably using Excel 2003 VBA 回答1: Not directly, no - the clipboard object seems to only contain the values of the cells (though Excel obviously somehow remembers the

Why use Range.Formula in VBA for Excel 2003 instead of Range.Value?

本小妞迷上赌 提交于 2019-12-29 00:23:52
问题 I was wondering why in VBA code for Excel 2003 do we even need to use Range.Formula to write a formula to a cell instead of just using Range.Cell ? They both write Strings to the cell that become forumlas, and the formula works (from what I've tested). ActiveCell.Value="=If(True,""yes"",""no"")" and ActiveCell.Formula="=If(True,""yes"",""no"")" do the same thing for me (when I select a cell and execute each of the above code segments separately in separate cells). They both show the "yes"

Dumping variant array to range - VBA excel error 1004

a 夏天 提交于 2019-12-28 06:38:54
问题 I'm using vba for Excel in order to save data into an array by: Dim allPosts As Variant allPosts = Range("A2:J5000") after that I'm changing data in the allPosts array, and then I want to paste it back by: Range("A2:J5000").Value = allPosts I'm getting the error: run time error 1004 Application-defined or object-defined and the copy stops at a specific cell, when i change the string at this cell to be shorter the problem is solved. thanks 回答1: You can use a second array to store the cell

Setting language, text direction and alignment in word document created by visual basic in excel

佐手、 提交于 2019-12-25 08:58:17
问题 I've made an excel visual basic script that takes data from an excel sheet, and produces a paragraph in a word sheet for each row. The default language for the document is Hebrew, with text aligned right and direction right to left. For one (the last) line in the paragraph, I want to set the language to English, the direction left to right, and the alignment right. Then, for the first line in the next paragraph change back to Hebrew, direction right to left and alignment right. When recording

open last modified excel spreadsheet using vba

走远了吗. 提交于 2019-12-25 05:26:13
问题 I have the following code that i have used to open the last modified CSV file, and have literally just changed the path name and extension, but it now doesnt work, would appreciate any pointers on where i am going wrong: Code i am using: Sub ReceiptTest() On Error Resume Next With Application.FileSearch .LookIn = "\\K123456\shared\IT Public\ReceiptsETE\Archive\": .Filename = "*.XLS*" .Execute msoSortByLastModified, msoSortOrderDescending For FF = 1 To .FoundFiles.Count If FileDateTime(

How to create dropdownlist on Excel 2003

瘦欲@ 提交于 2019-12-24 23:01:19
问题 I'm creating Excel files using AutomationFactory.CreateObject("Excel.Application") . I'm using these lines of codes to create a dropdown list: mySheet.Range("A1").Validation.Add(Type:=Interop.Excel.XlDVType.xlValidateList, _ AlertStyle:=Interop.Excel.XlDVAlertStyle.xlValidAlertStop, _ [Operator]:=Interop.Excel.XlFormatConditionOperator.xlBetween, Formula1:="=List!$C$3:$C$903") The formula (Formula1:="=List!$C$3:$C$903") returns 900 rows In Excel 2010 it works perfectly, however, in Excel 2003

SSIS Excel Source Connection. What does it use to read Excel?

雨燕双飞 提交于 2019-12-24 20:33:09
问题 Using SSIS, I Can use an OLE Connect with a Jet driver to read Excel or I can use a separate Connection type of "Excel Connection" Both seem to have issues reading files with merges cells, as I feared. I am curious what SSIS is using to connect to Excel when an "Excel Connection" is used. Other than VBA, what would you suggest for reading an Excel file that has merged cells, formulas, formatting, etc, on a server? I am using Excel 2003. Update Here's the code that I use to read the XLS: