Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help with my code
Hello all,
I have 2 worksheets, "Sheet 1" and "Sheet 2". First, my code checks the length of Cell "E26" in "Sheet 1". If the length of E26 is not equal to 6, delete the records (entire row) in "Sheet 2" with the values "A-1", "B-1" and "C-1" in column F of Sheet 2. Then move the records up that are below. The Sheet 2 has over 1000 records and has 10 columns with values. I have the following code, and when I executed it, I got a Type Mismatch error, and it pointed me to the line "If s2Record = "A-1" or s2Record = "B-1" or s2Record = "C-1" Then". If Len(Sheets("Sheet 1").Range("E26")) < 6 Then For Each s2Record in Worksheets("Sheet 2").Columns(6) If s2Record = "A-1" or s2Record = "B-1" or s2Record = "C-1" Then s2Record.EntireRow.Delete Shift:=xlShiftUp end if Next s2Record End If Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Slow code when used as VBA code instead of macro (copying visible columns) | Excel Programming | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
Excel code convert to Access code - Concat & eliminate duplicates | Excel Programming |