ukdane
12-22-2008, 02:24 AM
Hi, I have a couple of easy to solve questions for you guys.
1) What code can I add to "ThisWorkbook" so that no matter where a user inputs data, it will always be capitalised.
2) What VBA do I use to call the "Find" box, and how can I default it?
I've tried
Sub find()
'Find anything, anywhere
Cells.find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End Sub
but that only initializes the search, and I need the user to input a word to look for.
3) Column L (which is the 12 column) contains a series of dates. I want to create a macro which will automatically filter out anything except the days date +1 (tomorrows date) but the following code doesn't work:
Sub pudatosort()
Dim dagsdato As Date
Dim pudato As String
dagsdato = Date
pudato = dagsdato + 1
Selection.AutoFilter Field:=12, Criteria1:="=" & pudato
End Sub
When I run this, it only shows empty cells. (I've also tried "<", ">", "<=", "=>", and "<>" as the criteria, to obtain different results, but none of them work. Is it something to do with the format of the cells in column L or is it not possible to filter variables?
1) What code can I add to "ThisWorkbook" so that no matter where a user inputs data, it will always be capitalised.
2) What VBA do I use to call the "Find" box, and how can I default it?
I've tried
Sub find()
'Find anything, anywhere
Cells.find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End Sub
but that only initializes the search, and I need the user to input a word to look for.
3) Column L (which is the 12 column) contains a series of dates. I want to create a macro which will automatically filter out anything except the days date +1 (tomorrows date) but the following code doesn't work:
Sub pudatosort()
Dim dagsdato As Date
Dim pudato As String
dagsdato = Date
pudato = dagsdato + 1
Selection.AutoFilter Field:=12, Criteria1:="=" & pudato
End Sub
When I run this, it only shows empty cells. (I've also tried "<", ">", "<=", "=>", and "<>" as the criteria, to obtain different results, but none of them work. Is it something to do with the format of the cells in column L or is it not possible to filter variables?