Dear All,
I am again hitting my head against the wall with this simple bit of coding,
Sub get_Bang_data()
Dim sourcedate As Date
Dim ddate As Date
Sheets(1).Select
dname = [c3].Value
fname = [c4].Value
sourcedate = Range("c1"
.Value
ddate = Range("c2"
.Value
I am trying to get ddate value to = dddd, sourcedate works fine and formats the date as dd/mm/yy, but i get a type mismatch error on ddate, I am using the sourcedate and ddate in a find, and for the find to work, the variable needs to bet set with out the quotes(""
around the value, sourcedate does this fine this way, but I can not get ddate to go pass the last line of coding above, is there another way to do this, the values in c1 and c2 are entered via a calendar, they are identical just i need the formats to be different(dd/mm/yy - sourcedate, dddd = ddate, both have to end up with out quotes around). I am getting quite frustrated with this.
any help greatly appreciated, coding for find is below if it helps.
Set myrange = Rows("5:6"
myrange.Find(What:=sourcedate, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False).Activate
any quick response would be greatly appreciated.
Thanks Rob.![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)
I am again hitting my head against the wall with this simple bit of coding,
Sub get_Bang_data()
Dim sourcedate As Date
Dim ddate As Date
Sheets(1).Select
dname = [c3].Value
fname = [c4].Value
sourcedate = Range("c1"
ddate = Range("c2"
I am trying to get ddate value to = dddd, sourcedate works fine and formats the date as dd/mm/yy, but i get a type mismatch error on ddate, I am using the sourcedate and ddate in a find, and for the find to work, the variable needs to bet set with out the quotes(""
any help greatly appreciated, coding for find is below if it helps.
Set myrange = Rows("5:6"
myrange.Find(What:=sourcedate, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False).Activate
any quick response would be greatly appreciated.
Thanks Rob.
![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)