Re: Merging specific cells from multiple workbooks into one master workbook

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for responding J. I'm trying to modify it for my purposes, but
still without much success. I guess its too complicated. This is what I
have so far:

Public Sub SumBidsAccepted()
Const sPATH As String = _
"HD:Users:Gerard:Desktop:Bids-Accepted:"
Const sMSG As String = _
"Total Job Cost: $$" & vbNewLine & _
"Total Base Bid: %%" & vbNewLine & _
"Total Projected Profit: ##"
Const sSHEETNAME As String = "Labor Detail"
Const sJOBCOSTADDR = "R37C2" 'Cell A1
Const sBASEBIDADDR = "R42C2" 'Cell A2
Const sPROJPROFITADDR = "R43C2" 'Cell A3
Dim sXL4MArg As String
Dim sFileName As String
Dim dJobCost As Double
Dim dBaseBid As Double
Dim dProjProfit As Double
Dim sOldDir As String

sFileName = Dir(sPATH) 'Verify path and file exist
If sFileName <> "" Then
sOldDir = CurDir
ChDir sPATH
sXL4MArg = "'" & sPATH & "[$$]" & sSHEETNAME & "'!%%"
With Application
Do
dJobCost = dJobCost + ExecuteExcel4Macro( _
.Substitute(.Substitute(sXL4MArg, "%%", _
sJOBCOSTADDR), "$$", sFileName))
dBaseBid = dBaseBid + ExecuteExcel4Macro( _
.Substitute(.Substitute(sXL4MArg, "%%", _
sBASEBIDADDR), "$$", sFileName))
dProjProfit = dProjProfit + ExecuteExcel4Macro( _
.Substitute(.Substitute(sXL4MArg, "%%", _
sPROJPROFITADDR), "$$", sFileName))
sFileName = Dir()
Loop Until sFileName = ""
MsgBox .Substitute(.Substitute(.Substitute(sMSG, _
"$$", dJobCost), "%%", dBaseBid), "##",
dProjProfit)
End With
ChDir sOldDir
End If
End Sub

Can you see what I'm missing? :(

.



Relevant Pages

  • Re: SEVERE PROBLEM WITH WINDOWS MOVIE MAKER
    ... > Well I've tried to download that but without success since the site is NOT ... > responding. ... Please see below the error report: ...
    (microsoft.public.windowsxp.moviemaker)
  • Re: Font Capture
    ... tell me that some program isn't responding etc etc In this case the ... program is called "Font capture". ... I have run AVG without any success. ... came about after Adobe had been trying frantically to update itself, ...
    (uk.media.radio.archers)
  • Re: Sorting into different worksheets from a unique value
    ... I've adapted the code for my purposes without success and I have a few ... 'what is screen updating? ... 'it hits a blank. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Unexpected extra business for Eurostar
    ... at providing roughly a similar service, were not a success. ... But they weren't responding to a step change in the convenience of flying. ... The problem was that it didn't stop at Westbury (my most obvious local station as well as a major junction), and I had to drive to Warminster to pick it up. ...
    (uk.railway)
  • Re: Make MDE File Taking a LONG Time - Whats Normal
    ... Thanks for posting back with your success. ... Thank you for responding. ... The compile was done, ...
    (microsoft.public.access.forms)