IDM Error and IDM Macro

drmingle

Board Regular
Joined
Oct 5, 2009
Messages
229
These two references aren't on another machine:
  • IDM Error
  • IDM Macro
I am getting stuck on the command line that has items like the following with an object error:

Date
  • Time
  • my cell
1st block of code having issues
Code:
'****************Google Quotes*****************Sub AddQuote()
    For Each myCell In Range("J8")
    Range("J8") = Range("I8") & " " & Range("I9")
        If myCell.Value <> " " Then
            myCell.Value = Chr(34) & myCell.Value & Chr(34)
        End If
    Next myCell

2nd block of code having issues
Code:
'Get User Name
Sheets("SpeedLog").Range("A1").End(xlDown).Offset(1, 0).Value = "=udfGetUserName()"
'Speed Time
Sheets("SpeedLog").Range("C1").End(xlDown).Offset(1, 0).Value = DateDiff("s", start_time, end_time)
'Provider researched
Sheets("SpeedLog").Range("D1").End(xlDown).Offset(1, 0).Value = Sheets("CVTYSpeedSearch").Range("I8") & " " & Range("I9")
'Date
Sheets("SpeedLog").Range("B1").End(xlDown).Offset(1, 0).Value = Date
'Run Time
Sheets("SpeedLog").Range("E1").End(xlDown).Offset(1, 0).Value = Time
'Save File
myFile = ActiveWorkbook.Name
    ActiveWorkbook.Save
    ActiveWindow.ActivateNext
Do While myFile <> ActiveWorkbook.Name
    ActiveWorkbook.Save
    ActiveWindow.ActivateNext

My question is do I have to have the above named references to perform the sub on the other machines....(I don't really know what IDM Error or IDM Macro does).
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
This is an example of the problems we can get into if code is not commented correctly ie. given a proper desciption of what it is meant to do.
It is very difficult to understand someone else's code - especially if it is not working as required.
If you post further questions you will need to take a bit more care if you want an answer.
"I am getting stuck" is not a good enough description of your problem.
You have put a space into "my cell". This would not run in code - which actually says "myCell". It is a user defined variable name.
You have not said what 'IDM Error' or 'IDM Macro' is. My guess is that you have added spaces again and that these are variables too.
A good point is that you have attempted to display the code correctly, and it is indented correctly. You probably would not have got an answer otherwise. Few of us have time to decipher bad code - let alone try to understand it.
The code block at the top is nonsense as it stands because the code is set to run through a range of cells - which consists of 1 cell only.
We would really need to see all the code and a proper desciption of what you want out of it and what is going wrong.
See how much easier this is to read - with hardly any change at all :-
Code:
'=============================================================================
'- ADD QUOTATION CHARACTERS TO CONTENTS OF CELL J8
'=============================================================================
Sub AddQuote()
    Dim MyCell As Range
    Set MyCell = Range("J8")
    '-------------------------------------------------------------------------
    '- IF CELL IS NOT EMPTY THEN ADD QUOTES
    If MyCell.Value <> " " Then
        MyCell.Value = Chr(34) & MyCell.Value & Chr(34)
    End If
    '-------------------------------------------------------------------------
End Sub
I have added some information to the rest of your code.
The code adds information to the next empty cell at the bottom of a column in a worksheet called "SpeedLog"
Code:
    'Get User Name 
    '(*** USER DEFINED FUNCTION ****)
    Sheets("SpeedLog").Range("A1").End(xlDown).Offset(1, 0).Value = "=udfGetUserName()"
 
    'Speed Time 
    '(****DIFFERENCE BETWEEN 2 VARIABLES ****)
    Sheets("SpeedLog").Range("C1").End(xlDown).Offset(1, 0).Value = DateDiff("s", start_time, end_time)
 
    'Provider researched 
    '(***** 2 CELL CONTENTS CONCATENATED)
    Sheets("SpeedLog").Range("D1").End(xlDown).Offset(1, 0).Value = Sheets("CVTYSpeedSearch").Range("I8") & " " & Range("I9")
 
    'Date 
    '(**** SYSTEM DATE TO CELL ****)
    Sheets("SpeedLog").Range("B1").End(xlDown).Offset(1, 0).Value = Date
 
    'Run Time 
    (**** SYSTEM TIME TO CELL ***)
    Sheets("SpeedLog").Range("E1").End(xlDown).Offset(1, 0).Value = Time
 
    'Save File
    '(**** SAVE THE FILE ***)
    myFile = ActiveWorkbook.Name
    ActiveWorkbook.Save
    '-----------------------------------------------------------------------------
    '- (**** SAVE (but not close) ALL OTHER OPEN WORKBOOKS ********)
    ActiveWindow.ActivateNext
    Do While myFile <> ActiveWorkbook.Name
        ActiveWorkbook.Save
        ActiveWindow.ActivateNext
        myFile = ActiveWorkbook.Name
    Loop
    '------------------------------------------------------------------------------
 
Upvote 0

Forum statistics

Threads
1,216,459
Messages
6,130,758
Members
449,588
Latest member
accountant606

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top