Question : Inserting Rows in Excel with VBA

I need to modify the code below slightly to insert a couple of rows on "first" (per code below).  This is probably the line I need to make that happen,

.EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

So in contrast, this is apply it to the first instance as oppose to the code below, which is applying it to all instances after the first instance.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
Sub zapit2(targetRange As Range, what As String)
Dim found As Range, first As Range
Set first = targetRange.Find(what, After:=Range("A" & Rows.Count), LookIn:=xlValues, LookAt:=xlWhole)
If Not first Is Nothing Then
    Set found = targetRange.FindNext(first)
    Do While (Not found Is Nothing)
        If (found.Address = first.Address) Then Exit Do
         'found.Clear  '''''clears the cell found
         'found.EntireRow.Clear
         'found.EntireColumn.Clear
         found.Resize(, 5).Clear  '''''changes the size of the range A:E
         
        Set found = targetRange.FindNext(found)
    Loop
End If
End Sub

Sub zapit()
Dim targetRange As Range
' change this to where you want to work on
Set targetRange = ActiveSheet.Range("A:A")
zapit2 targetRange, "Grp1"
zapit2 targetRange, "Grp2"

End Sub

Answer : Inserting Rows in Excel with VBA

Not sure if you have Facebook Connect on your site.  If not, take a look at this tutorial page on to implement Share button/link.  Then you can just stick a <img> tag between the <a></a> with your custom button image.  For example:
<a name="fb_share" type="icon" share_url="YOUR_URL"><img src="/img/custombutton.png"></a>.  That way your custom button gets displayed with clickable FB link.

If you have Facebook Connect implemented, I'm sure there's a way to customize it too, but I haven't looked into it.

Random Solutions  
 
programming4us programming4us