VBA Help, probs really simple
-
Hi, I need some help with a VBA script in Excel 2003, its probably really simple but the macro recorder hasnt been much use and im not sure how to start. All I want to do is: Check a worksheet value (i.e. in call A1), for the first value check on another worksheet list >> If this value is in a row, delete this row and all rows containing this value, if not, do nothing and check the next record Then move onto the next record (i.e. in cell C2) until there are no records left to check How would I do this please (or can you give me advise on how to do something similar so I can make a start at finding a solution?). Many thanks in advance
-
Hi, I need some help with a VBA script in Excel 2003, its probably really simple but the macro recorder hasnt been much use and im not sure how to start. All I want to do is: Check a worksheet value (i.e. in call A1), for the first value check on another worksheet list >> If this value is in a row, delete this row and all rows containing this value, if not, do nothing and check the next record Then move onto the next record (i.e. in cell C2) until there are no records left to check How would I do this please (or can you give me advise on how to do something similar so I can make a start at finding a solution?). Many thanks in advance
I won't write code for exactly what you need but I have got similar example.
Sub CheckList()
Sheet1.Cells(1, 1) = "Text1" 'Set text in Sheet1 Sheet2.Cells(1, 1) = "Text1" 'Set Text in Sheet2 Dim sValueFromSheet1 As String Dim sValueFromSheet2 As String sValueFromSheet1 = Sheet1.Cells(1, 1) 'Get Value of Cell A1 on sheet1 sValueFromSheet2 = Sheet2.Cells(1, 1) 'Get value from list on sheet2 If sValueFromSheet1 = sValueFromSheet2 Then Sheet1.Activate 'This will delete 1st Row Rows("1:1").Select Selection.Delete Shift Range("A1").Select End If ' Now for your question you will have to write your own code ' to do what you want to. I can't do everything for you. ' ' Hope this example helps you.
End Sub
- Stop thinking in terms of limitations and start thinking in terms of possibilities -