Re: Count different values for another value
use this data starting from A2
=IF(A2=$A$2:$A$8,COUNTIF($B$2:$B$8,$B$2:$B$8),)
Re: Count different values for another value
use this data starting from A2
=IF(A2=$A$2:$A$8,COUNTIF($B$2:$B$8,$B$2:$B$8),)
Re: ADO SQL Query Ignoring YEAR in the Date
upload your .csv file delete data which is crutial ill have a look at when i get back home
Re: Filter Multiple Fields in Userform
another helpfull links
http://www.ozgrid.com/forum/showthread.php?t=158906
Re: Printing information with certain template
what have you tried so far...
Re: Filter Multiple Fields in Userform
have a look at this
Re: Require Cells Between Two Values to be Filled with "1"
use this
where A2 has start date B2 has end date and from C2 paste this formula =IF(AND($A$2<=C1,$B$2>=C1),1,0)
Re: Locking Merged cells before save
use unprotect first and then try to lock the cell i thought you will modify my code so i havent used unprotect in the first place.
Re: Locking Merged cells before save
try this
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim rng1 As Range
Dim rng2 As Range
On Error Resume Next
Set rng1 = Intersect(Cells.SpecialCells(xlFormulas), Cells.SpecialCells(xlBlanks))
Set rng2 = Intersect(Cells.SpecialCells(xlConstants), Cells.SpecialCells(xlBlanks))
On Error GoTo 0
ActiveSheet.UsedRange.Locked = False
If Not rng1 Is Nothing Then rng1.Locked = True
If Not rng2 Is Nothing Then rng2.Locked = True
ActiveSheet.Protect "Password"
End Sub
Display More
Re: Require Cells Between Two Values to be Filled with "1"
put this in A2 and drag till A14
=IF(AND($A$1=1,$A$15=1),1,0)
Re: problem with SqLQuery in VBA
Quote
so function need to be working in bout direction even srtX is null or srtY is null
if both criterias will be null then what will you pass in your query..
Re: Getting Username when workbook is opened Readonly
try this
Sub TestVBA()
'// Just change the file to test here
Const strFileToOpen As String = "Cata.xls"
If IsFileOpen(strFileToOpen) Then
MsgBox strFileToOpen & " is already Open" & _
vbCrLf & "By " & LastUser(strFileToOpen), vbInformation, "File in Use"
Else
MsgBox strFileToOpen & " is not open", vbInformation
End If
End Sub
Function IsFileOpen(strFullPathFileName As String) As Boolean
Dim hdlFile As Long
On Error GoTo FileIsOpen:
hdlFile = FreeFile
Open strFullPathFileName For Random Access Read Write Lock Read Write As hdlFile
IsFileOpen = False
Close hdlFile
Exit Function
FileIsOpen:
'// Someone has it open!
IsFileOpen = True
Close hdlFile
End Function
Private Function LastUser(strPath As String) As String
Dim strXl As String
Dim strFlag1 As String, strflag2 As String
Dim i As Integer, j As Integer
Dim hdlFile As Long
Dim lNameLen As Byte
strFlag1 = Chr(0) & Chr(0)
strflag2 = Chr(32) & Chr(32)
hdlFile = FreeFile
Open strPath For Binary As #hdlFile
strXl = Space(LOF(hdlFile))
Get 1, , strXl
Close #hdlFile
j = InStr(1, strXl, strflag2)
#If Not VBA6 Then
'// Xl97
For i = j - 1 To 1 Step -1
If Mid(strXl, i, 1) = Chr(0) Then Exit For
Next
i = i + 1
#Else
'// Xl2000+
i = InStrRev(strXl, strFlag1, j) + Len(strFlag1)
#End If
'// IFM
lNameLen = Asc(Mid(strXl, i - 3, 1))
LastUser = Mid(strXl, i, lNameLen)
End Function
Display More
Re: VBA to click checkbox in Internet Explorer
is the link accessable from outside means can i see have the webpage so that i can take a look of that invisible combobox ID.
Re: Macro needed to enable and disable an Active X ComboBox
there's some problem in your file the code doesn't work at all tried deleting the combobox but the excel crashes every time i tried...
suggest you to create a new workbook and try it as the code is proper
Re: Count a range of labels, split in half and highlight the top half
here you go
Sub test()
Dim cnt As Double
cnt = WorksheetFunction.RoundDown(WorksheetFunction.CountA(Range("A:A")) / 2, 0)
Range("A:C").Interior.Color = xlNone
With Range("A1:C" & cnt).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
End Sub
Display More
Re: Using VBA can we check the FONT format all the files in a Specific Folder
Glad you got it working...
Re: Using VBA can we check the FONT format all the files in a Specific Folder
use the updated code from my latest post #9
Re: Using VBA can we check the FONT format all the files in a Specific Folder
hi bindu use this and only keep the excel files into the folder for which you want to get the status
Option Explicit
Sub test()
Dim wbk As Workbook, path As String, i As Long, fname As String, cell As Variant, font_cri As String
path = ActiveSheet.Range("B3").Value '<--- Path of the folder
font_cri = ActiveSheet.Range("C3").Value
ThisWorkbook.Worksheets("Font Checker").usedrange.ClearContents
fname = Dir(path & "\", vbNormal)
Do While fname <> ""
Set wbk = Workbooks.Open(path & "\" & fname)
For i = 1 To wbk.Worksheets.Count
For Each cell In wbk.Worksheets(i).UsedRange
If cell.Font.Name <> font_cri Then
With ThisWorkbook.Worksheets("Font Checker")
.Range("A" & Range("A:A").Rows.Count).End(xlUp).Offset(1, 0).Value = wbk.FullName
.Range("B" & Range("B:B").Rows.Count).End(xlUp).Offset(1, 0).Value = wbk.Worksheets(i).Name
.Range("C" & Range("C:C").Rows.Count).End(xlUp).Offset(1, 0).Value = cell.Address(0, 0) & "-" & cell.Value & "- Arial Font Is Not Matching"
End With
End If
Next cell
Next i
wbk.Close False
fname = Dir()
Loop
ThisWorkbook.Worksheets("Font Checker").Range("A1").Value = "File Name"
ThisWorkbook.Worksheets("Font Checker").Range("B1").Value = "Sheet Name"
ThisWorkbook.Worksheets("Font Checker").Range("C1").Value = "cell Value and address"
End Sub
Display More
Re: Macro needed to enable and disable an Active X ComboBox
sure currently in office can downolad your file here will look when i get back home...