Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete row
I am trying to run a macro or do some sort of VBA code which after it is
run, will delete every fifth row in my excel file. I have some 45700 rows in my excel file, and I will take hours to delete these rows by hand. Please help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete row
Have a look he
http://www.mcgimpsey.com/excel/deleteeverynthrow.html ABCD wrote: I am trying to run a macro or do some sort of VBA code which after it is run, will delete every fifth row in my excel file. I have some 45700 rows in my excel file, and I will take hours to delete these rows by hand. Please help. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF Not Calculating Properly
(Excel 2007, Windows XP)
I have a function which is giving me some grief. (Code below.) It's supposed to search through a range of 10 cells, each of which is individually named, and check to see if a string is there. (It gets the value of the string from the Index function) If that string is there, it takes a number from an adjacent cell, and reports that as the function value. Several identically formatted worksheets contain this function, and the same named ranged (local names, created with the Name Manager add-in). It works perfectly, for a while, but then at some point I notice the function is reporting the wrong value: either a value from one of the other sheets, or 0, or #Value. I can't figure out why. Here's the function: Function LoveDeity(rgReligion As Range, rgPassionNames As Range, rgPassionScores As Range) As Integer Dim ws As Worksheet, i As Integer ' the next line was added in a vain attempt to get it to work ' it seemed to work - for a while 'Application.Volatile True ' I've tried the function without the following line ' and removing the ws bits in the For Next loop below ' with no joy Set ws = rgReligion.Worksheet Dim strReligion As String Dim strDeity As String Dim strPassion As String Dim strPassionScore As String strReligion = rgReligion.Value If strReligion = "" Then Exit Function strDeity = RemoveBrackets(CheckReligiousTable(strReligion, "Deity")) With ws For i = 1 To 10 strPassion = .Range("Passion" & i).Value strPassion = RemoveBrackets(strPassion) If strPassion = strDeity Then strPassionScore = "Passion" & i & "Value" Exit For End If Next i If strPassionScore = "" Then LoveDeity = 0 Exit Function End If ' this bit was put in to cut down on writes to the worksheet. ' "MyLoveDeity" is the cell that contains this UDF ' The problem occurs whether this line is included or not. If .Range(strPassionScore).Value < .Range("MyLoveDeity").Value Then LoveDeity = .Range(strPassionScore).Value End If End With ' the next line was added in another vain attempt to get the UDF to work ' it seemed to work - for a while Application.Calculate End Function Thanks in advance, Darren. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming |