IF THEN with a copy and dialog box

ojackiec

New Member
Joined
Dec 5, 2005
Messages
17
I was asked to create several macros for an in-house project since I have some (very limited) programming skills. I have done pretty well except for two things. I have a set of field logs that come in and need to have reports created. My problems are as follows:

1. I need to be able to take data entered through a user form (i.e. a leak value that might be a single number or a range) and filter the field log by that info. In other words, a tech will enter a value into the user form. The field log must then be filtered by that value and certain information placed in a new sheet. I can create the user form. I need help with the code to use that input to filter the field log and copy certain columns into a new sheet.

2. I have created a user form that allows the tech to insert his/her name, ID, etc. I have also created a header with the same titles. How do I get the input from the user form to show up in the header? (i.e. I have a header code that says "Technician Name:" "Technician ID:" etc. but need the actual input to enter in after the title.)

Thanks a bunch to anyone who can help.
 
ojackiec said:
I'm having trouble with the

Code:
Names.Add "SCREEN", "=D" & ToRow
The names aren't showing up as they should. It is skipping the required number of rows, though.

How are you expecting them to be showing up? :unsure:
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
The words aren't showing up in the cells like I want them to. Should it be done like I did before where a said .Range("A2").Value = SCREEN?
If so would I put it together this way:

Code:
.Range("D", ToRow).Value = "SCREEN"

I really appreciate all of the help you've been.
 
Upvote 0
Thanks again. I figured out my problem. Well, I found one way to solve it! Don't know if it's the best way! Here's what I did (for others that might have my issue!):

Code:
ToSheet.Cells(ToRow, 4).Value = "SCREEN"
        ToSheet.Cells(ToRow, 7).Value = "REPAIR_METHOD"
        ToRow = ToRow + 1

Thanks again!!
 
Upvote 0
Oh! Yeah, that's what you want, then. Names.Add actually adds a named range to the worksheet.

If this is what you're really wanting to do, you actually *can* have spaces and symbols in the cells.

As I thought you were adding named ranges, I took them out. So your original text of "REPAIR METHOD:" and so on would work in this case. :)
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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