I've spent an embarrassing amount of time and frustration simply attempting to delete a cell. Please help me understand the scope of the problem statement in addition to any common techniques for using the subject methods efficiently and concisely.
A specific problem that highlights my ignorance is described below.
I will set a range to a cell and attempt to delete it and it consistently deletes the cell just below a given row. I will even go as far as to prove that the cell is set to a given row and column with a MsgBox ("Column: " & rng_todelete.Offset(ColumnOffset:=i).Column & vbCr & "Row: " & rng_todelete.Offset(ColumnOffset:=i).row) line of code just before rng_todelete.Delete and I still delete the cell just below rng_todelete.Delete is located.
The loop encompassing that Set rng_todelete = rng.Offset(0, i) line is also unnecessary. I can resize that to delete 5 rows with an expression similar to rng.Offset(some arg.).Resize( ColumnSize:= 5).
Please help me understand .delete/.resize/.offset methods. I'm trying very hard to avoid .selection/.select methods.
All this code is trying to do is compare 5 consecutive cells of code and delete duplicate sets of 5 identical consecutive cells across a few hundred columns. This should be very simple.
Thank youPlease Login or Register to view this content.
Bookmarks