JustAnswer > Programming
Ask A Question|Register|Login|Help
JustAnswer

Programming

Ask a Programming Question, Get an Answer ASAP!

Have your own Programming question?

6 Programmers are Online Now
characters left:
Not a Programming Question?
Bookmark and Share

Question

VBA Excel program, I want to delete a certain section "mercy" is the name of the code I want to delete or remove from several modules, not sure how?

Submitted: 311 days and 22 hours ago.
Category: Programming
Value: $22
Status: AWAITING CUSTOMER ACTION
+
Read More

Optional Information

OS: Windows 98; Browser: Mozilla

Already Tried:

Public Sub Totals()
Dim x As Variant
Dim T As Variant
Dim y As Variant
Dim row As Variant
Dim column As Variant
Dim w As Variant
Dim z As Variant

Sheets("CNA").Activate
row = 1
column = 1
T = FrmTotals.DTPicker1.Value

Do Until Cells(row, column).Value = FrmTotals.DTPicker1.Value
row = row + 1
If Cells(row, column).Value < 1 Then Exit Do
Select Case FrmTotals.DTPicker1.Value
    Case Is < Cells(row, column).Value
       MsgBox ("Data not found for " & FrmTotals.DTPicker1.Value & _
        " . Please verify your data.")
              
        Exit Sub
End Select
Loop
row = row
Do Until Sheets("CNA").Cells(row, 1).Value > FrmTotals.DTPicker2.Value
z = Cells(row, 1).Value
If Cells(row, 1).Value < 1 Then Exit Do
Select Case Cells(row, 2).Value
        Case Is = "IRF"
            Select Case Cells(row, 3).Value
               Case Is = "Day"
                    
                    Do Until Cells(row, 3).Value = "EVE"
                    If Cells(row, 3).Value = "EVE" Then Exit Do
                    If Cells(row, 3).Value < 1 Then Exit Do
                        Select Case Cells(row, 4).Value
                            Case Is = "CNA"
                                x = Cells(row, 5).Value
                                y = Cells(row, 6).Value
                                Sheets("Totals").Range("I21").Value = Sheets("Totals").Range("I21").Value + ((x * 8) / y)
                        End Select
                    
                    row = row + 1
                    Loop
               Case Is = "EVE"
                    
                    Do Until Cells(row, 3).Value = "NOC"
                    If Cells(row, 3).Value = "NOC" Then Exit Do
                    If Cells(row, 3).Value < 1 Then Exit Do
                        Select Case Cells(row, 4).Value
                            Case Is = "CNA"
                                x = Cells(row, 5).Value
                                y = Cells(row, 6)

Posted by John D 311 days and 22 hours ago.

Info Request

Hi,

 

Is "mercy" the name of the sub routine or the function, or is a named range in the workbook?

 

It would help if you can elaborate a little on what want you are trying to do.

 

311 days and 22 hours ago.

Reply

It is the named range in the workbook, this was handed off to me and I am new to VBA. I hope this helps.

Accepted Answer

Ok, if you just want to remove a named range you do not need to do it in VBA. Here is how you can do it

.

In Excel main page (for Excel 97-2003) click Insert > Name > Define, then look in the list for "mercy", select it and click the Delete button. This will delete this range from the workbook, but you will need to correct all references to that name which will start showing an error because the name does not exists anymore.

 

Hope this helps. Let me know if you have any questions.

 

Picture
Expert: John D
Pos. Feedback: 99.8 %
Accepts: 1231
Answered: 4/3/2009

BS Degree in Engineering

20 years experience in Excel programming and various major applications.

311 days and 22 hours ago.

Reply

I am not seeing the name, I apologize I am new to VBA so it is possible that it is a sub

311 days and 22 hours ago.

Reply

I am not seeing the name, I apologize I am new to VBA so it is possible that it is a sub

Accepted Answer

It could be a sub, or function, or even a text entry in one of the cells or cell formulas. I can help you locate it, but can you please tell me what is the purpose of this exercise, do you just want to delete all instances of the word wherever it occurs in that workbook.

 

If you want me to remove it for you, you can send me the file through www.wikisend.com then when you get the 'Download Link' copy it and paste it in your reply here.

 

Thanks for the accept.

 

 

Picture
Expert: John D
Pos. Feedback: 99.8 %
Accepts: 1231
Answered: 4/3/2009

BS Degree in Engineering

20 years experience in Excel programming and various major applications.

311 days and 22 hours ago.

Reply

http://wikisend.com/download/600428/HPPD - RN LPN fix mercy.xls

I would also like to know how to proceed with this issue as well if that is possible.

Accepted Answer

I got the file, thanks.

 

Ok, there is no "mercy" in the named ranges, but there are plenty of cells that have the word "mercy", and that word also exists in several VBA modules.

 

So please let me know what exactly do you want me to do with this word, i.e. delete it and leave blank in its place, or replace it by another word , or what.

 

Also I will need to have the password as some sheets are protected.

 

 

 

Picture
Expert: John D
Pos. Feedback: 99.8 %
Accepts: 1231
Answered: 4/3/2009

BS Degree in Engineering

20 years experience in Excel programming and various major applications.

311 days and 21 hours ago.

Reply

When the program runs I no longer want the mercy code to be read, that site is no longer operational and no longer do we need to track.

the password ierh. sorry this has been given to me and I am still new at vba.

Posted by John D 311 days and 21 hours ago.

Answer

Ok, here you go:

 

http://wikisend.com/download/910116/HPPD%20-%20RN%20LPN%20fix%20mercy%20XYZ.xls

 

I have replaced all instances of "Mercy" in the all the worksheets by the word "XYZ"

and

I have replaced all instances of "Mercy" in all the VBA module to the "ZYX" (i.e the reverse of XYZ).

 

That way the code will lose any connection to the cells that have now XYZ in them. And at the same time you can keep track where the word Mercy used to be, both in the worksheets and the code (note: with these changes the codes may not run as or do what they were intended to)

 

I hope this is what you wanted to do. If not please let me know and we can look at it again.

 

Thank you again for the accepts and please feel free to get back to me if you need further assistance.

 

 

+
Read More

Related Programming Questions

  • IF I USE THE INSTALLER, SHOULD I FILE IT SOMWHERE OR DELETE
  • write a program that gets a float value from the user and di...
  • Define, in your own words, the terms front-end and back-end
  • l 1. In a separate JS file, write a function
  • How do you build methods, or function. Example, I want to op...
  • Trying to get site to load properly in IE6/7/8. Obviously
  • I have used Homesite 5.5 happily for years. Yesterday someth...
  • I paid a guy over a year ago to set up a web site for my bus...



Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Question List | Become an Expert | Terms of Service | Security & Privacy | About Us
© 2003-2010 JustAnswer Corp.