It probably would be easier to have preformatted sheet pull data from Access instead of Access pushing to Excel. I have a workbook doing that. See post 6 in https://www.accessforums.net/access/...cel-31411.html
It probably would be easier to have preformatted sheet pull data from Access instead of Access pushing to Excel. I have a workbook doing that. See post 6 in https://www.accessforums.net/access/...cel-31411.html
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
well it's going great now, repacing "Sat" with - " & Chr(34) & "SAT" & Chr(34) & " has fixed the syntax issue and the formula is now accepted, sample of working code below. don't even need the sheet names, all rows in the list are updated correctly as well.
Current_Worksheet.Range("M8").Formula = "=IF(OR($B8 = " & Chr(34) & "Sat" & Chr(34) & ", $B8 = " & Chr(34) & "Sun" & Chr(34) & "), 0, IF($K8 > 8, 8, $K8))"
Current_Worksheet.Range("N8").Formula = "=IF($B8=" & Chr(34) & "Sun" & Chr(34) & ",0,IF(AND($B8=" & Chr(34) & "Sat" & Chr(34) & ",$K8<=4),$K8,IF(AND($B8=" & Chr(34) & "Sat" & Chr(34) & ",$K8>4),4,IF(AND($B8<" & Chr(34) & "Sat" & Chr(34) & ",$K8>8,$K8<=11),$K8-8,IF(AND($B8<" & Chr(34) & "Sat" & Chr(34) & ",$K8>11),11-8,0)))))"
Current_Worksheet.Range("O8").Formula = "=IF($B8=" & Chr(34) & "Sun" & Chr(34) & ",$K8,IF(AND($B8=" & Chr(34) & "Sat" & Chr(34) & ",$K8>4),$K8-4,IF(AND($B8=" & Chr(34) & "Sat" & Chr(34) & ",$K8<=4),0,IF(AND($B8<" & Chr(34) & "Sat" & Chr(34) & ",$K8>11),$K8-11,0))))"
Current_Worksheet.Range("P8").Formula = "=SUM($M8:$O8)"
Current_Worksheet.Range("Q8").Formula = "=($O8*2)+($N8*1.5)+$M8"
thankyou very much for halping with this.