-
WSAndrewKKWalker
AskWoody LoungerNot sure where you were expecting to get file size from.
You need in VBA to use the Microsoft Scripting Runtime library.
You can set this in Tools ReferencesThen you can set a scripting filesystem object
and from that get the basic file information.The function below returns the size in Bytes of the file whose folder and path are passed.
Code:Function GetFileSize(strFile As String, Optional strFolder As String) Dim lngFSize As Long, lngDSize As Long Dim oFO As File Dim oFD As Folder Dim OFS As New FileSystemObject lngFSize = 0 Set OFS = New Scripting.FileSystemObject If Not IsMissing(strFolder) Then If strFolder = "" Then strFolder = ActiveWorkbook.Path If Right(strFolder, 1) "" Then strFolder = strFolder & "" If strFile "" Then If OFS.FolderExists(strFolder) Then If OFS.FileExists(strFolder & strFile) Then Set oFO = OFS.GetFile(strFolder & strFile) Set oFD = OFS.GetFolder(strFolder) lngFSize = oFO.Size lngDSize = oFD.Size End If End If End If End If GetFileSize = lngFSize 'You could use lngDSize to return instead the size of the Directory End Function
-
WSAndrewKKWalker
AskWoody LoungerNovember 2, 2011 at 11:58 am in reply to: Case-sensitve VLOOKUP not working with Lower Case #1305059Difficult to know without the data.
The formula you have is looking for the value in E41, so IF you want to look for the value in E1 the formula in C1 ought to be=INDEX(AcType!$B$1:$B$4178,MATCH(TRUE,EXACT(E1,Ac Type!$A$1:$A$4178),0)) (Entered with SHIFT CTRL and ENTER)
This should look for a case sensitive match with the value in E1
Looking for a match in A1:A4178 on the AcType sheet, and bringing back the corresponding value from B1:B4178 on the AcType sheet.#N/A implies it cannot find a match.
It can be as simple as an extra space in the data in E1
-
WSAndrewKKWalker
AskWoody LoungerNovember 2, 2011 at 11:45 am in reply to: Case-sensitve VLOOKUP not working with Lower Case #1305057Have a look at the updated attached file.
-
WSAndrewKKWalker
AskWoody LoungerNovember 2, 2011 at 11:34 am in reply to: Case-sensitve VLOOKUP not working with Lower Case #1305054The module is not quite right as far as I can see.
It ought to be
Code:Function CaseVLook(compare_value, table_array As Range, _ Optional col_index As Integer = 1) Dim c As Range Dim rngColumn1 As Range Application.Volatile 'This line was wrong Set rngColumn1 = table_array.Columns(1) CaseVLook = "Not Found" 'Loop first column For Each c In rngColumn1.Cells If c.Value = compare_value Then CaseVLook = c.Offset(0, col_index).Value Exit For End If Next c End Function
Mind you that is for my data below …..
-
WSAndrewKKWalker
AskWoody LoungerNovember 2, 2011 at 11:22 am in reply to: Case-sensitve VLOOKUP not working with Lower Case #1305052You can try it with Exact and using Match and Index
I have attached an example file
-
WSAndrewKKWalker
AskWoody LoungerThis not the complete answer, but it may give you a possible option.
It uses Match to determine the row position of the text string in the other sheet
It uses the Hyperlink function with the address function to build a Dynamic Link
It does assume that the match is the entire cell content.
There are variations of a solution to show how the formula is built up.Anyway, it’s in the attached file.
If it helps ok, if not (all knowledge is good) -
WSAndrewKKWalker
AskWoody LoungerOctober 31, 2011 at 2:52 pm in reply to: Excel formula does not show values if formula edited #1304767Formatting the cell as Text causes that problem, rather than curing it.
Thanks Rory.
Interesting, I was just going on hearsay on that one.
That is what they told me, I had not encountered the issue.I do know that the data for the main bulk is imported,
but the columns that are showing the issue are ones that have been inserted after the import.
I just wonder if they got the wrong end of the stick regarding text.Infact, thinking ??????????????????????? about it,
I reckon the cells may have been set as text format after the import.
Then new columns inserted are getting the same text format as adjacent ones.
If you change the format back to General it does not change it back to an answer unless you edit the formula.Hmmmmm.
I will let you know the outcome shortly ……..
And I have just tested that theory and VOILA!I probably should have looked at the sheet in more detail, but they wouldn’t let me play with it!
AND I was a tad preoccupied at the time with some complex vba coding.Many Thanks for a nudge in the right direction!
-
WSAndrewKKWalker
AskWoody LoungerOctober 31, 2011 at 10:46 am in reply to: Excel formula does not show values if formula edited #1304700Probably not.
It is not my data, and is highly confidential anyway.
AND.. I am not sure I will be allowed a copy to post even if sanitised.
If I can I will upload it.
I am also going to see if it still ocurs in 2010, but I cannot do that until Thu. -
WSAndrewKKWalker
AskWoody LoungerI assume these are text string, not real dates.
Do you want to just change the text strings , or convert them to real dates?If you want to convert the string use a formula
=Mid(CellRef,3,2)&Left(CellRef,2)&Right(CellRef,4)
If You want to convert the string to a real date then use
=Date(Right(CellRef,4),Left(CellRef,2),Mid(CellRef,3,2)) and use a format to show as a date
Where CellRef is the appropriate Cell Reference.
-
WSAndrewKKWalker
AskWoody LoungerYou can change the Font in Custom Header and Footer to use assorted Symbol and Wingdings,
BUT you would need to know the character to use or the ALT key press to create.
It might be easier to copy and paste them from the sheet.e.g A Book symbol is Wingdings &
-
WSAndrewKKWalker
AskWoody LoungerI just tested this on my Laptop, running Windows 7 Ultimate and Office 2003, 2007 and 2010.
In all cases it generated the Rank and Percentile data using the Add-In from your 11000+ rows of random data
in 20 to 23 seconds.That is with 4GB Ram.
-
WSAndrewKKWalker
AskWoody LoungerPattern Fills were removed in 2007.
But you could use Andy Popes Add-In Here
-
WSAndrewKKWalker
AskWoody LoungerIf you look at the result of the formula in G9 on your sheet as a number it returns -0.45
Which as Steve points out is a Negative number, because you are using addition and subtraction in your formula,
even though you don’t need negative numbers, you are getting them hence the ################# result.IF you are saying there will be negatives, but you do not want them, then you will need to use an IF to make sure that they
are eliminated
e.g. =IF(Your Formula <0,"",Your Formula) or equivalentAlso you have a Custom Format of hh:mm;@
If the total time is likely to exceed 24 hours and you want it in hours and minutes
then you should choose to use [h]:mm as the time component.Whatever you do, you need to stop the negative calculations or you will get ##########.
-
WSAndrewKKWalker
AskWoody LoungerNo worries!
Code was still good, and it allows for xls and xlsx etc!
Although you might be better using InstrRev to search for the . from the Right side
It still returns the position counting from the left, but starts search on the right,
because now file names can have . in the file name
e.g. MyFile.1.1.1.xlsSo here, Instr looking for a . would return the value 7
But InstrRev would return 13To check if file exists
Easiest is probably to use Dir Function
IF Dir(Path & File) = “” then ‘It Does Not exist
The Update below uses this with a Message Box Function to give the user a choice of buttons to press
Code:Sub Save_to_PDF() ' ' Save_to_PDF Macro ' Dim strFileName As String, strPath As String, strPDFName As String Dim intReply As Integer strFileName = ActiveWorkbook.Name strPath = ActiveWorkbook.Path & "" strPDFName = Left(strFileName, Len(strFileName) - 5) & ".pdf" 'Check for File If Dir(strPath & strPDFName) "" Then intReply = MsgBox("A File named " & strPDFName & vbLf & "Already exists in Folder" & vbLf & strPath _ & "Do you want to Replace it?", vbQuestion + vbYesNo + vbDefaultButton1, "File Exists") If intReply = vbYes Then ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=strPath & strPDFName, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False MsgBox "Saved To PDF " & strPDFName End If End If End Sub
Arcturus16a.
The reason for the extra . was I suspect because you are using an .xlsx not an .xls so it needs to crop the 5 characters (see above)
That is why alifrog solution (see above as well) is good because it looks for the . -
WSAndrewKKWalker
AskWoody LoungerI’ve not used it, but if I interpret what you want correctly it ought to be a bit like this
Code:Sub Save_to_PDF() ' ' Save_to_PDF Macro ' Dim strFileName as String, strPath as String, strPDFName as String strFileName=ActiveWorkBook.Name strPath="DriveLetter:FolderSubFolder" 'Put Your Path Here or Use strPath=ActiveWorkBook.Path & "" strPDFName=Left(strFileName,Len(strFileName)-4) & ".pdf" ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:= strPath & strPDFName, _ Quality:= xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False MsgBox "Saved To PDF" End Sub
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Office gets current release
by
Susan Bradley
3 hours, 16 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
8 hours, 39 minutes ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
5 hours, 23 minutes ago -
Stop the OneDrive defaults
by
CWBillow
9 hours, 28 minutes ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
19 hours, 24 minutes ago -
X Suspends Encrypted DMs
by
Alex5723
21 hours, 35 minutes ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
21 hours, 53 minutes ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
22 hours, 30 minutes ago -
OpenAI model sabotages shutdown code
by
Cybertooth
23 hours, 8 minutes ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
11 hours, 17 minutes ago -
Enabling Secureboot
by
ITguy
18 hours, 17 minutes ago -
Windows hosting exposes additional bugs
by
Susan Bradley
1 day, 7 hours ago -
No more rounded corners??
by
CWBillow
1 day, 2 hours ago -
Android 15 and IPV6
by
Win7and10
16 hours, 35 minutes ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
1 day, 19 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
1 day, 22 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
1 day, 16 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
2 days, 5 hours ago -
May preview updates
by
Susan Bradley
1 day, 16 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
1 day, 8 hours ago -
Just got this pop-up page while browsing
by
Alex5723
1 day, 21 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
1 day, 18 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
20 hours, 51 minutes ago -
At last – installation of 24H2
by
Botswana12
2 days, 20 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
17 hours, 37 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
3 days, 9 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
1 day, 7 hours ago -
Limited account permission error related to Windows Update
by
gtd12345
3 days, 22 hours ago -
Another test post
by
gtd12345
3 days, 22 hours ago -
Connect to someone else computer
by
wadeer
3 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.