<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>VBA Forum RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest threads from the 'VBA' forum at Programmer's Heaven, excluding replies.</description>
    <language>en</language>
    <copyright>Copyright 2008 Programmers Heaven</copyright>
    <pubDate>Mon, 01 Dec 2008 20:26:26 -0700</pubDate>
    <lastBuildDate>Mon, 01 Dec 2008 20:26:26 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Delete entire ROW if a cell contains a phrase</title>
      <link>http://www.programmersheaven.com/mb/vba/382436/382436/delete-entire-row-if-a-cell-contains-a-phrase/</link>
      <description>I am trying to write a small piece of code for an Excel macro.  I am working with some ladies here who use an excel spreadsheet to export some of the numbers from their system to their customer.&lt;br /&gt;
&lt;br /&gt;
I need a quick macro that can examine each line of the .xls file and if a certain phrase appears in a cell (for instance, any cell in column C) then have it delete that entire line.&lt;br /&gt;
&lt;br /&gt;
Additionally, if another macro (or maybe even an extension of the first macro, but it may be easier to have two separate macros) that could look at another row, like row FIVE, and if it contains all zeros for cells D-AA (or whatever it goes to) then I would like to have it remove that entire row if it has nothing but zeros from a certain cell over.&lt;br /&gt;
&lt;br /&gt;
Any help would be greatly appreciated.  I haven't had the privilege to work much with Excel with regards to creating macros and such.&lt;br /&gt;
&lt;br /&gt;
Thanks in advance!&lt;br /&gt;</description>
      <pubDate>Mon, 01 Dec 2008 10:53:56 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>code is replacing value, but should adding instead</title>
      <link>http://www.programmersheaven.com/mb/vba/381990/381990/code-is-replacing-value-but-should-adding-instead/</link>
      <description>Hello,&lt;br /&gt;
&lt;br /&gt;
This vba takes a code from sheet4 and searches the match through sheet2. If finds it, then copies the corresponding value from sheet4 to sheet2.&lt;br /&gt;
Sample:&lt;br /&gt;
&lt;br /&gt;
Sheet4&lt;br /&gt;
(the code, col i)     (the value, col K)&lt;br /&gt;
123456789              &lt;span style="color: Red;"&gt;200&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Sheet2&lt;br /&gt;
&lt;br /&gt;
(the code, in one of the columns c, e:m)      (the value, col AD)&lt;br /&gt;
123456789                                     &lt;span style="color: Red;"&gt;value to here&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
And the code itself:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;Private Sub searchMATCH()

Dim a, b(), i As Long
With Sheets("sheet4")
    a = .Range("i1", .Range("i" &amp;amp; Rows.Count).End(xlUp)).Resize(, 3).Value
End With
With CreateObject("Scripting.Dictionary")
    .CompareMode = vbTextCompare
    For i = 1 To UBound(a, 1)
        For ii = 1 To 11
.Item(a(i, 1)) = a(i, 3)
        Next
    Next
    With Sheets("sheet2")
        a = .Range("c1", .Range("c" &amp;amp; Rows.Count).End(xlUp)).Resize(, 11).Value
    End With
    ReDim b(1 To UBound(a, 1), 1 To 1)
    For i = 1 To UBound(a, 1)
        For ii = 1 To UBound(a, 2)
            If .exists(a(i, ii)) Then
                b(i, 1) = .Item(a(i, ii))
                Exit For
            End If
        Next
    Next
End With
Sheets("sheet2").Range("ad1").Resize(UBound(b, 1)).Value = b
End Sub
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
But the problem is, if there are more than 1 matching codes on sheet4(only) then the vba replaces the value with the last corresponding value. &lt;br /&gt;
But i need it to be added on to last value (+).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On sheet4:     VALUE&lt;br /&gt;
123456789      200&lt;br /&gt;
123456789      300&lt;br /&gt;
&lt;br /&gt;
Then it should be on sheet2 not 300 but 200&lt;strong&gt;+300&lt;/strong&gt; (eg 500)&lt;br /&gt;
&lt;br /&gt;
Can anyone fix this?&lt;br /&gt;
&lt;br /&gt;
Than you!&lt;br /&gt;
&lt;br /&gt;
Sincerely,&lt;br /&gt;
Martin&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Tue, 18 Nov 2008 00:53:20 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>writing VBA to make TAB cycle through text boxes</title>
      <link>http://www.programmersheaven.com/mb/vba/381969/381969/writing-vba-to-make-tab-cycle-through-text-boxes/</link>
      <description>Hi all,&lt;br /&gt;
&lt;br /&gt;
I have created several text boxes on my word document and wanted to have TAB cycle through them&lt;br /&gt;
&lt;br /&gt;
It kind of workd, but the moment there is something in the text box, it stops working.&lt;br /&gt;
&lt;br /&gt;
Can someone tell me what I am doing wrong:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;Private Sub PROSPECTNAME_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

Dim TxtBox As Object

If KeyCode = vbKeyTab Then

ActiveDocument.PROSPECTCODE.Activate

End If

End Sub&lt;/pre&gt;&lt;br /&gt;</description>
      <pubDate>Mon, 17 Nov 2008 10:13:25 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>writing VBA to make TAB cycle through text boxes</title>
      <link>http://www.programmersheaven.com/mb/vba/381968/381968/writing-vba-to-make-tab-cycle-through-text-boxes/</link>
      <description>Hi all,&lt;br /&gt;
&lt;br /&gt;
I have created several text boxes on my word document and wanted to have TAB cycle through them&lt;br /&gt;
&lt;br /&gt;
It kind of workd, but the moment there is something in the text box, it stops working.&lt;br /&gt;
&lt;br /&gt;
Can someone tell me what I am doing wrong:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;Private Sub PROSPECTNAME_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

Dim TxtBox As Object

If KeyCode = vbKeyTab Then

ActiveDocument.PROSPECTCODE.Activate

End If

End Sub&lt;/pre&gt;&lt;br /&gt;</description>
      <pubDate>Mon, 17 Nov 2008 10:13:25 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Cant find my error...</title>
      <link>http://www.programmersheaven.com/mb/vba/381884/381884/cant-find-my-error/</link>
      <description>Hi i did try to figure out where i went wrong but i am not the best at this could some one assist me ? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-=-=-=-=-=-=-=-=-=-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ActiveWorkbook.Worksheets("Data").Activate&lt;br /&gt;
&lt;br /&gt;
Dim LSearchRow As Integer&lt;br /&gt;
Dim LCopyToRow As Integer&lt;br /&gt;
&lt;br /&gt;
LSearchRow = 2&lt;br /&gt;
LCopyToRow = 2&lt;br /&gt;
&lt;br /&gt;
While Len(Range("A" &amp;amp; CStr(LSearchRow)).Value) &amp;gt; 0&lt;br /&gt;
&lt;br /&gt;
    If Range("C" &amp;amp; CStr(LSearchRow)).Value = 1 Then&lt;br /&gt;
&lt;br /&gt;
        Rows(CStr(LSearchRow) &amp;amp; ":" &amp;amp; CStr(LSearchRow)).Select&lt;br /&gt;
        Selection.Copy&lt;br /&gt;
&lt;br /&gt;
        Sheets("Status1").Select&lt;br /&gt;
        Rows(CStr(LCopyToRow) &amp;amp; ":" &amp;amp; CStr(LCopyToRow)).Select&lt;br /&gt;
        ActiveSheet.Paste&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        LCopyToRow = LCopyToRow + 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        For Column = 1 To 500&lt;br /&gt;
           Sheets("Status1").Columns(Column).AutoFit&lt;br /&gt;
        Next&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Sheets("Data").Select&lt;br /&gt;
                    &lt;br /&gt;
    End If 'Closing of "Status1" If statement.&lt;br /&gt;
&lt;br /&gt;
ActiveWorkbook.Worksheets("Data").Activate&lt;br /&gt;
&lt;br /&gt;
Application.CutCopyMode = False&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MsgBox "All matching data has been copied."&lt;br /&gt;
&lt;br /&gt;
Exit Sub&lt;br /&gt;
&lt;br /&gt;
Err_Execute:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    If Err &amp;gt; 0 Then MsgBox "An error occurred, Error number: " &amp;amp; Err.Number &amp;amp; ": " &amp;amp; Err.Description&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Exit Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
could some one help m,e please?&lt;br /&gt;
&lt;br /&gt;
thank you &lt;br /&gt;
&lt;br /&gt;
WaLaSy&lt;br /&gt;</description>
      <pubDate>Fri, 14 Nov 2008 09:40:28 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Excel - Dynamic COUNTIF Forrmula</title>
      <link>http://www.programmersheaven.com/mb/vba/381836/381836/excel---dynamic-countif-forrmula/</link>
      <description>I am not an expert VBA writer but can typically adapt codes to effectively provide the output I desire. However after two days I am admitting defeat.&lt;br /&gt;
&lt;br /&gt;
My plans was to adapt this coding I found to:&lt;br /&gt;
    For i = 1 To 10000&lt;br /&gt;
        If Len(Range("J" &amp;amp; i)) = 0 Then&lt;br /&gt;
            If Len(Range("I" &amp;amp; i)) &amp;gt; 0 Then&lt;br /&gt;
                Range("J" &amp;amp; i).Formula = "=INT(RAND()*100)"&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
    Next i&lt;br /&gt;
&lt;br /&gt;
This is the formula I need to insert in the new blank column created next to column "I":&lt;br /&gt;
     '=COUNTIF($I$2:$I$1941,I2)&lt;br /&gt;
&lt;br /&gt;
But I have been unsuccessful because the range changes each time as the list will begin longer or shorter. Please help and I greatly appreciate your help.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is my entire VBA information if it helps.&lt;br /&gt;
Sub Delete_with_Autofilter_Two_Criteria()&lt;br /&gt;
    Dim DeleteValue1 As String&lt;br /&gt;
    Dim DeleteValue2 As String&lt;br /&gt;
    Dim rng As Range&lt;br /&gt;
    Dim calcmode As Long&lt;br /&gt;
    Dim i As Integer&lt;br /&gt;
&lt;br /&gt;
    With Application&lt;br /&gt;
        .Calculation = xlCalculationManual&lt;br /&gt;
        .ScreenUpdating = False&lt;br /&gt;
    End With&lt;br /&gt;
    &lt;br /&gt;
    Rows("1:2").Select&lt;br /&gt;
    Selection.Delete Shift:=xlUp&lt;br /&gt;
&lt;br /&gt;
    'Fill in the two values that you want to delete&lt;br /&gt;
    DeleteValue1 = "NULL"&lt;br /&gt;
    DeleteValue2 = " "&lt;br /&gt;
&lt;br /&gt;
    'Sheet with the data, you can also use Sheets("MySheet")&lt;br /&gt;
    With ActiveSheet&lt;br /&gt;
&lt;br /&gt;
        'Firstly, remove the AutoFilter&lt;br /&gt;
        .AutoFilterMode = False&lt;br /&gt;
&lt;br /&gt;
        'Apply the filter&lt;br /&gt;
        .Range("I1:I" &amp;amp; .Rows.Count).AutoFilter Field:=1, _&lt;br /&gt;
        Criteria1:=DeleteValue1, Operator:=xlOr, Criteria2:=DeleteValue2&lt;br /&gt;
&lt;br /&gt;
        With .AutoFilter.Range&lt;br /&gt;
            On Error Resume Next&lt;br /&gt;
            Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _&lt;br /&gt;
                      .SpecialCells(xlCellTypeVisible)&lt;br /&gt;
            On Error GoTo 0&lt;br /&gt;
            If Not rng Is Nothing Then rng.EntireRow.Delete&lt;br /&gt;
        End With&lt;br /&gt;
&lt;br /&gt;
        'Remove the AutoFilter&lt;br /&gt;
        .AutoFilterMode = False&lt;br /&gt;
    End With&lt;br /&gt;
&lt;br /&gt;
    With Application&lt;br /&gt;
        Range("J:J").Insert Shift:=xlToRight&lt;br /&gt;
        Range("J1").Select&lt;br /&gt;
        ActiveCell.FormulaR1C1 = "Counter"&lt;br /&gt;
    End With&lt;br /&gt;
    &lt;br /&gt;
    '=COUNTIF($I$2:$I$1941,I2)&lt;br /&gt;
        &lt;br /&gt;
    For i = 1 To 10000&lt;br /&gt;
        If Len(Range("J" &amp;amp; i)) = 0 Then&lt;br /&gt;
            If Len(Range("I" &amp;amp; i)) &amp;gt; 0 Then&lt;br /&gt;
                Range("J" &amp;amp; i).Formula = "=INT(RAND()*100)"&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
    Next i&lt;br /&gt;
    &lt;br /&gt;
    With Application&lt;br /&gt;
        .ScreenUpdating = True&lt;br /&gt;
        .Calculation = xlCalculationAutomatic&lt;br /&gt;
    End With&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;</description>
      <pubDate>Thu, 13 Nov 2008 08:10:06 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Delete All Rows Except...</title>
      <link>http://www.programmersheaven.com/mb/vba/381813/381813/delete-all-rows-except/</link>
      <description>Hi All,&lt;br /&gt;
&lt;br /&gt;
I'm new here.&lt;br /&gt;
I have a questions that i could not find the answer.&lt;br /&gt;
I'm also new in macro VBA programming.&lt;br /&gt;
The question is, I need to delete all rows in excel except the last row and any rows that contain this word "Blocked".&lt;br /&gt;
Anyone with brilliant idea?&lt;br /&gt;
Thanks :)&lt;br /&gt;</description>
      <pubDate>Wed, 12 Nov 2008 19:08:30 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Word VBA : fields update</title>
      <link>http://www.programmersheaven.com/mb/vba/378501/378501/word-vba--fields-update/</link>
      <description>Hello&lt;br /&gt;
&lt;br /&gt;
Hello&lt;br /&gt;
&lt;br /&gt;
I've been working on a macro enabling a user to update a Word document linked to an Excel workbook. The macro open the Excel file if it closed, then the user can modify the Excel file before updating the Word document.&lt;br /&gt;
&lt;br /&gt;
The code below works quite well approximately 9 times out of 10. Unfortunately, sometimes the following errors happen :&lt;br /&gt;
- the Excel file does not open&lt;br /&gt;
- the Excel file opens but it is impossible to update the fields&lt;br /&gt;
- the Excel file window is not activated, so the user thinks that it cannot open it (actually it is opened, but hidden behind the Word window).&lt;br /&gt;
&lt;br /&gt;
Any ideas ?&lt;br /&gt;
&lt;br /&gt;
Here is the code :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sub Updatelinks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dim xlApp As Object&lt;br /&gt;
Dim xlWB As Object&lt;br /&gt;
&lt;br /&gt;
Set xlApp = CreateObject("Excel.Application")&lt;br /&gt;
&lt;br /&gt;
On Error Resume Next&lt;br /&gt;
&lt;br /&gt;
Set xlApp = GetObject(, "Excel.Application")&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set xlWB = xlApp.Workbooks("Champs automatiques.xls")&lt;br /&gt;
&lt;br /&gt;
On Error GoTo 0 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'Open the Excel file if it is closed&lt;br /&gt;
&lt;br /&gt;
If xlWB Is Nothing Then&lt;br /&gt;
&lt;br /&gt;
xlApp.AskToUpdateLinks = False &lt;br /&gt;
&lt;br /&gt;
Set xlWB = xlApp.Workbooks.Open("H:\OBLIGS\Breve\Modeles\Cham
ps automatiques.xls", ReadOnly:=True)&lt;br /&gt;
&lt;br /&gt;
xlApp.Visible = True&lt;br /&gt;
&lt;br /&gt;
End If&lt;br /&gt;
&lt;br /&gt;
ActiveDocument.Fields.Update&lt;br /&gt;
&lt;br /&gt;
End sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thank you for your help !&lt;br /&gt;</description>
      <pubDate>Thu, 09 Oct 2008 10:17:35 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>send active msword file to my vb application as mail merge</title>
      <link>http://www.programmersheaven.com/mb/vba/378240/378240/send-active-msword-file-to-my-vb-application-as-mail-merge/</link>
      <description>hi there,&lt;br /&gt;
&lt;br /&gt;
wondering if anyone out there can help me with this. been looking high and low on the internet for a solution and doesnt seem to look like someone has done this before. I want to create a menu on msword toolbar to sort of like attach the active document to my vb app. possible?&lt;br /&gt;
&lt;br /&gt;
appreciate any help.&lt;br /&gt;
&lt;br /&gt;
-ejay56</description>
      <pubDate>Tue, 07 Oct 2008 07:04:38 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Self-editing programs</title>
      <link>http://www.programmersheaven.com/mb/vba/377590/377590/self-editing-programs/</link>
      <description>I am new to programming, but I was wondering, how could I make a program that makes one random change to its programming based on a dictionary of commands and then reproduces?   Thank you in advance for this somewhat odd request.</description>
      <pubDate>Sat, 04 Oct 2008 16:19:32 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Search in excel.</title>
      <link>http://www.programmersheaven.com/mb/vba/376649/376649/search-in-excel/</link>
      <description>Hi all.. im new here.. and was wondering if you can help?&lt;br /&gt;
&lt;br /&gt;
im looking for some vb script for excel that will do a search.&lt;br /&gt;
&lt;br /&gt;
if  i explain  you might understand. &lt;br /&gt;
&lt;br /&gt;
sheet1 wil have a search box and button.&lt;br /&gt;
&lt;br /&gt;
say i look for a contact, i enter his name click search. &lt;br /&gt;
&lt;br /&gt;
then it searches sheet2 for the row with all the info.&lt;br /&gt;
then it displays it in a popup box in sheet one. &lt;br /&gt;
&lt;br /&gt;
i have look every where i can can find and google can only search so much.&lt;br /&gt;
&lt;br /&gt;
please help..  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;</description>
      <pubDate>Wed, 01 Oct 2008 05:55:01 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Refferer Crawler</title>
      <link>http://www.programmersheaven.com/mb/vba/376466/376466/refferer-crawler/</link>
      <description>where can i find this kind of code? or anyone can develop it?&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.shamelesstraffic.com/shameless/RefererCrawl.aspx"&gt;Referer Crawler&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
the program is crawl, visit and leave a referrer url into server log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
thanks.&lt;br /&gt;</description>
      <pubDate>Tue, 30 Sep 2008 10:46:16 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>An slice of archiving code... trouble for me.. plz assist.</title>
      <link>http://www.programmersheaven.com/mb/vba/376151/376151/an-slice-of-archiving-code-trouble-for-me-plz-assist/</link>
      <description>I am writing a piece of code for excel to back up a worksheet to a location before it runs another routine.&lt;br /&gt;
&lt;br /&gt;
My problem is how to close the saved worksheet and activate the source worksheet.&lt;br /&gt;
&lt;br /&gt;
Open_Name = ActiveWorkbook.FullName&lt;br /&gt;
&lt;br /&gt;
  My_date = Format$(Now, "mm-dd-yy")&lt;br /&gt;
&lt;br /&gt;
  Path = "C:\codetest\backup"&lt;br /&gt;
&lt;br /&gt;
  ActiveWorkbook.SaveAs Filename:=Path &amp;amp; "\dave-" &amp;amp; My_date &amp;amp; ".xlsm",  FileFormat:=xlOpenXMLWorkbookMacroEnabled&lt;br /&gt;
&lt;br /&gt;
    MsgBox ("File has been saved to " &amp;amp; Path &amp;amp; " as " &amp;amp; "dave-" &amp;amp; My_date &amp;amp; ".xlsm")&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;&amp;gt;&amp;lt;&amp;gt; the active workbook is now located in codetest\backup\dave-My_date&lt;br /&gt;
but I want to open and activate Open_Name and close Dave-my_date&lt;br /&gt;
 please help. &amp;lt;&amp;gt;&amp;lt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thanks for any help you folks can provide.&lt;br /&gt;</description>
      <pubDate>Sat, 27 Sep 2008 13:51:13 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>newbie needs help!</title>
      <link>http://www.programmersheaven.com/mb/vba/376000/376000/newbie-needs-help/</link>
      <description>hi!&lt;br /&gt;
&lt;br /&gt;
I'm trying to make an excel spreadsheet that can automatically hide rows when a cell value on that row is not equivalent to the value on a reference row. I'm not really that good with VB so I really do not know what to write on the macro&lt;br /&gt;
&lt;br /&gt;
here is what I would like to happen..&lt;br /&gt;
&lt;br /&gt;
let b1 = ref.cell&lt;br /&gt;
&lt;br /&gt;
jump to cell c3&lt;br /&gt;
&lt;br /&gt;
if c3=b3 then &lt;br /&gt;
     move down to the cell bellow the current cell&lt;br /&gt;
  else&lt;br /&gt;
     hide current row then move down to the cell bellow the current cell&lt;br /&gt;
&lt;br /&gt;
do this if statement while current cell&amp;lt;=bottom cell of the range&lt;br /&gt;
&lt;br /&gt;
I hope I can get an answer here. I've been working on the spreadsheet for a week now trying to accomplish it without macros but until now I still haven't found any solution.&lt;br /&gt;
&lt;br /&gt;
using macro is my only hope for it&lt;br /&gt;
&lt;br /&gt;
thanks in advance&lt;br /&gt;</description>
      <pubDate>Thu, 25 Sep 2008 04:58:15 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>need help with sendkeys to a .exe program</title>
      <link>http://www.programmersheaven.com/mb/vba/375763/375763/need-help-with-sendkeys-to-a-exe-program/</link>
      <description>My wish is to automate through Excel, where from I will be selecting numbers from a specified column of a worksheet. Those numbers will be decrypted by the program ABC.exe.&lt;br /&gt;
The 1st part of the code is to activate command prompt. Then from there I m initiating the program abc.exe. The window title changes from "c:\Windows\system32\cmd.exe" to "c:\Windows\system32\cmd.exe - abc.exe". But as abc.exe is initiated. Sendkeys is not working.&lt;br /&gt;
 My code is as follows: (It's supposed to start execution with a button click from a worksheet)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)&lt;br /&gt;
Dim WshShell As Object&lt;br /&gt;
Dim screen As Object&lt;br /&gt;
Dim cvc As Object&lt;br /&gt;
Dim strScrBatch As String&lt;br /&gt;
Dim strStandard As String&lt;br /&gt;
Dim psi As Object&lt;br /&gt;
&lt;br /&gt;
Private Sub CommandButton1_Click()&lt;br /&gt;
    &lt;br /&gt;
    Set WshShell = CreateObject("WScript.Shell")&lt;br /&gt;
    WshShell.Run "C:\WINDOWS\system32\cmd.exe"&lt;br /&gt;
    Sleep 20&lt;br /&gt;
    WshShell.SendKeys "cd.."&lt;br /&gt;
    WshShell.SendKeys "{Enter}"&lt;br /&gt;
    WshShell.SendKeys "cd XYZ"&lt;br /&gt;
    WshShell.SendKeys "{Enter}"&lt;br /&gt;
    Sleep 50&lt;br /&gt;
    WshShell.SendKeys "ABC.EXE"&lt;br /&gt;
    WshShell.SendKeys "{Enter}"&lt;br /&gt;
&lt;br /&gt;
    strScrBatch = (Range("E" &amp;amp; 2).Value)&lt;br /&gt;
    strStandard = (Range("E" &amp;amp; 3).Value)&lt;br /&gt;
    &lt;br /&gt;
    SendKeys strScrBatch, True&lt;br /&gt;
    &lt;br /&gt;
    WshShell.SendKeys strScrBatch&lt;br /&gt;
    WshShell.SendKeys "{Enter}"&lt;br /&gt;
  &lt;br /&gt;
    WshShell.SendKeys strStandard&lt;br /&gt;
  &lt;br /&gt;
    WshShell.SendKeys "{Enter}"&lt;br /&gt;
    &lt;br /&gt;
    MsgBox "Task Complete"&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Mon, 22 Sep 2008 02:37:34 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Certificates</title>
      <link>http://www.programmersheaven.com/mb/vba/375658/375658/certificates/</link>
      <description>Hey, y'all,&lt;br /&gt;
&lt;br /&gt;
I am having the worst time getting a certificate to work on my spreahsheet. Is there anybody out there who has worked with these?&lt;br /&gt;
&lt;br /&gt;
Thank you!&lt;br /&gt;
&lt;br /&gt;
PC&lt;br /&gt;</description>
      <pubDate>Fri, 19 Sep 2008 18:06:55 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>TCP/IP - How do I use the winsock or wsock32 DLLs?</title>
      <link>http://www.programmersheaven.com/mb/vba/375388/375388/tcpip---how-do-i-use-the-winsock-or-wsock32-dlls/</link>
      <description>OKIE DOKIE,&lt;br /&gt;
&lt;br /&gt;
After quite a bit of poking and prodding my computer (and cussing and talking lovingly)...&lt;br /&gt;
&lt;br /&gt;
Attached is the module, and this is the buttom I'm using for testing:&lt;br /&gt;
&lt;br /&gt;
Private Sub CommandButton1_Click()&lt;br /&gt;
    'ip.text is a text box that contains "126.125.81.3"&lt;br /&gt;
    WinsockInit&lt;br /&gt;
    MsgBox HostByAddress(ip.Text)&lt;br /&gt;
    MsgBox HostByName(HostByAddress(ip.Text))&lt;br /&gt;
    MsgBox InetAddrStringToLong(ip.Text)&lt;br /&gt;
    MsgBox InetAddrLongToString(InetAddrStringToLong(ip.Text)
)    &lt;br /&gt;
    WSACleanUp&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sooooo....how do I connect to anything and listen and talk to it? In case it matters, it is proprietary equipment; the data is not in any particular format or protocol I don't think. I can see it in Hyperterm. I just want the data raw for post-processing.</description>
      <pubDate>Tue, 16 Sep 2008 19:01:49 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>click image in web page</title>
      <link>http://www.programmersheaven.com/mb/vba/375387/375387/click-image-in-web-page/</link>
      <description>hi, &lt;br /&gt;
&lt;br /&gt;
i already have vba to navigate to a web page.  i just need some code to click on an image in the web page.  i checked thhe source of the html, and it looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;table id="Menu_4_i0" onmouseout="Menu.Out(this);" width="100%" rmCss="MenuItem" rmLab="View Reports" class="MenuItem" onmouseover="Menu.Over(this);" cellspacing="0" rmCssOver="MenuItemOver" cellpadding="0"&amp;gt;&lt;br /&gt;
			&amp;lt;tr onclick="goTo('/Reports/ReportList.asp', '')"&amp;gt;&lt;br /&gt;
				&amp;lt;td width="26"&amp;gt;&amp;lt;img src="http://www.programmersheaven.com/Shared/Images/Icons/smallIcon_View
.gif"&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
				&amp;lt;td nowrap class="MenuItem"&amp;gt;View Reports&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so i am trying to figure out how i can use vba to click on the view reports image or item.&lt;br /&gt;
&lt;br /&gt;
thanks in advance,&lt;br /&gt;
geebee&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Tue, 16 Sep 2008 18:33:07 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>VBA and FTP server file transfer</title>
      <link>http://www.programmersheaven.com/mb/vba/375119/375119/vba-and-ftp-server-file-transfer/</link>
      <description>Hi all, &lt;br /&gt;
This is my first post so do not criticize me to much :) &lt;br /&gt;
&lt;br /&gt;
The system i am using is access 2007 VBA and is where the file i wish to transfer is generated. &lt;br /&gt;
&lt;br /&gt;
I am having a large amount of difficulty transferring a file from a local drive to an FTP server.&lt;br /&gt;
&lt;br /&gt;
I have all the relevant information i.e.:&lt;br /&gt;
  server address&lt;br /&gt;
  username&lt;br /&gt;
  password&lt;br /&gt;
&lt;br /&gt;
I have tried a few ways but all efforts have been fruitless.&lt;br /&gt;
&lt;br /&gt;
Have tried copy but it does not allow me to enter the relevant user name and password and tends to crash regardless of this information. &lt;br /&gt;
&lt;br /&gt;
Through the use of Code that operates using the Dos prompt.&lt;br /&gt;
&lt;br /&gt;
The files that i wish to transfer are xml files for a website database and all i need to do is place the files on the server&lt;br /&gt;
&lt;br /&gt;
Any comment or help will be much appreciated&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 11 Sep 2008 04:10:26 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>click link in web page</title>
      <link>http://www.programmersheaven.com/mb/vba/375017/375017/click-link-in-web-page/</link>
      <description>i have some code fills out a login screen and then results in landing on the splash/menu page. what i am having trouble coming up with is going from here to simulate clicking on a "view reports" link within the page landed on. attached is an "TRY" spreadsheet example containing my code. since the website is secure i cannot prodive its direct link or address at this time. any help would be GREATLY appreciated.&lt;br /&gt;
&lt;br /&gt;
thanks in advance,&lt;br /&gt;
geebee&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=199"&gt;TRY.xls&lt;/a&gt; (23040 bytes | downloaded 56 times)</description>
      <pubDate>Mon, 08 Sep 2008 05:55:43 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Display data from rows to column using VBA</title>
      <link>http://www.programmersheaven.com/mb/vba/374776/374776/display-data-from-rows-to-column-using-vba/</link>
      <description>Hi i would really need some help here with VBA. I am quite new to programming. I have some data in excel that is display in rows. I want them to display in column instead. Any idea how i can do it? i did some coding but it only display the first line of code. &lt;br /&gt;
&lt;br /&gt;
Initial Result:&lt;br /&gt;
John	S1	Math	1&lt;br /&gt;
John	S1	English	2&lt;br /&gt;
John	S1	Chinese	3&lt;br /&gt;
Benny	S2	Sci	C&lt;br /&gt;
Benny	S2	Hist	D&lt;br /&gt;
Benny	S2	Geo	E&lt;br /&gt;
Ken	S3	Bio	C&lt;br /&gt;
Ken	S3	Chem	C&lt;br /&gt;
Ken	S3	Phy	A&lt;br /&gt;
Joyce	S4	Lit	A&lt;br /&gt;
Joyce	S4	French	E&lt;br /&gt;
Joyce	S4	German	D&lt;br /&gt;
&lt;br /&gt;
Expected result:&lt;br /&gt;
John	S1	Math	A	English	B	Chinese	C&lt;br /&gt;
Benny	S2	Math	C	English	D	Geo	D&lt;br /&gt;
Ken	S3	Bio	C	Chem	C	Phy	A&lt;br /&gt;
Joyce	S4	Lit	A	French	E	German	D&lt;br /&gt;
&lt;br /&gt;
How can i go abt doing dis? my coding looks like this:&lt;br /&gt;
Private Sub CommandButton1_Click()&lt;br /&gt;
x = 1&lt;br /&gt;
n = 1&lt;br /&gt;
i = 1&lt;br /&gt;
&lt;br /&gt;
    For x = 1 To 1&lt;br /&gt;
        Sheet2.Cells(n, 1).Value = Sheet1.Cells(2, i)&lt;br /&gt;
        Sheet2.Cells(n, 2).Value = Sheet1.Cells(2, (i + 1))&lt;br /&gt;
        Sheet2.Cells(n, 3).Value = Sheet1.Cells(2, (i + 2))&lt;br /&gt;
        Sheet2.Cells(n, 4).Value = Sheet1.Cells(2, (i + 3))&lt;br /&gt;
        Sheet2.Cells(n, 5).Value = Sheet1.Cells((2 + x), (i + 2))&lt;br /&gt;
        Sheet2.Cells(n, 6).Value = Sheet1.Cells((2 + x), (i + 3))&lt;br /&gt;
        Sheet2.Cells(n, 7).Value = Sheet1.Cells((2 + x + 1), (i + 2))&lt;br /&gt;
        Sheet2.Cells(n, 8).Value = Sheet1.Cells((2 + x + 1), (i + 3))&lt;br /&gt;
        x = x + 1&lt;br /&gt;
        n = n + 1&lt;br /&gt;
        i = i + 1&lt;br /&gt;
        Next&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Tue, 02 Sep 2008 00:19:44 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>What is the result of Application.names.count ?</title>
      <link>http://www.programmersheaven.com/mb/vba/374731/374731/what-is-the-result-of-applicationnamescount-/</link>
      <description>&lt;span style="font-size: xx-small;"&gt;I have searched but failed to understand the code below, anybody could kindly help:&lt;br /&gt;
&lt;br /&gt;
i = 1 to Application.names.count   and &lt;br /&gt;
name1 = Application.Names(i).name&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
What is the result of :&lt;br /&gt;
&lt;br /&gt;
1) Application.names.count and&lt;br /&gt;
2) Application.Names(i).name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thank you very much&lt;br /&gt;
&lt;/span&gt;</description>
      <pubDate>Mon, 01 Sep 2008 01:51:41 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>File Access</title>
      <link>http://www.programmersheaven.com/mb/vba/374597/374597/file-access/</link>
      <description>Hi All&lt;br /&gt;
&lt;br /&gt;
 We have a folder 'WBInstance', which is permission denied for user 'xxx'.&lt;br /&gt;
&lt;br /&gt;
 Whether user 'xxx' the folder through vba code or passing someother login and password having access rights through vba.&lt;br /&gt;
&lt;br /&gt;
Thank you in advance&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Rema&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 28 Aug 2008 02:53:15 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>FoxPro? (urgent help needed... pls? anyone?)</title>
      <link>http://www.programmersheaven.com/mb/vba/374455/374455/foxpro-urgent-help-needed-pls-anyone/</link>
      <description>my teacher gave me an assignment that is about FoxPro. the problem that he gave me is to create a program for a video rental shop. this will include the "add-edit-delete record" commands. i have worked on some syntaxes but still am not able to make it work. and i also have to make a window that will generate another window and so on. i will attach what i have started on so far... help from anyone would be appreciated... by the way, im using a version 6.0 of visual foxpro. thanks so much... &lt;br /&gt;
&lt;br /&gt;
SET TALK OFF&lt;br /&gt;
SET ECHO OFF&lt;br /&gt;
SET CONFIRM OFF&lt;br /&gt;
SET SAFETY OFF&lt;br /&gt;
&lt;br /&gt;
USE VIDLIST *---[DATABASE]&lt;br /&gt;
INDEX ON LASTNAME TO VIDLIST&lt;br /&gt;
INDEX ON LASTNAME+FIRSTNAME TO VIDLIST&lt;br /&gt;
&lt;br /&gt;
Clear&lt;br /&gt;
&lt;br /&gt;
wait window "add/edit/delete record?" to nreply&lt;br /&gt;
&lt;br /&gt;
Do case &lt;br /&gt;
case nreply $ "Aa"&lt;br /&gt;
	do addrec&lt;br /&gt;
case nreply $ "Ee"&lt;br /&gt;
	do editrec&lt;br /&gt;
case nreply $ "Dd"&lt;br /&gt;
	do _delerec&lt;br /&gt;
case nreply $ "Pp"&lt;br /&gt;
	do _printrec&lt;br /&gt;
end case&lt;br /&gt;
PROCEDURE ADDRC&lt;br /&gt;
Clear&lt;br /&gt;
vlastnme=space(15)&lt;br /&gt;
vfirstnme=(10)&lt;br /&gt;
vaddress=space(15)&lt;br /&gt;
vage=0&lt;br /&gt;
vgender=space(1)&lt;br /&gt;
&lt;br /&gt;
@1.1 say "enter lastname :  " get vlatname vfirstname&lt;br /&gt;
@2.1 say "enter firstname : " get vfirstname&lt;br /&gt;
@3.1 say "enter address : "get vaddress &lt;br /&gt;
&lt;br /&gt;
read&lt;br /&gt;
wait window "do you want to save (y/n)? "to nans  &lt;br /&gt;
if nans $ "Yy" &lt;br /&gt;
	append blank &lt;br /&gt;
	replace lastname with vlastname, firstname with vfirstname, age with vage,: address with vaddress&lt;br /&gt;
else &lt;br /&gt;
	wait window "record not save"&lt;br /&gt;
return &lt;br /&gt;
*-----{procedure for editing record}&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------------------------------------&lt;br /&gt;
procedure editingrec&lt;br /&gt;
set index to enrolist2&lt;br /&gt;
vlastname=space(15)&lt;br /&gt;
vfirstname=space(15)&lt;br /&gt;
@1.1  say "enter lastname to edit : "get vlastname"&lt;br /&gt;
@2.1  say "enter vfirstname to edit : "get vfirstname"&lt;br /&gt;
read&lt;br /&gt;
*locate for lastname=vlastname&lt;br /&gt;
seek for lastname for vfirstname&lt;br /&gt;
if found ()&lt;br /&gt;
	wait window "record is active"......."&lt;br /&gt;
	vlastname=lastname&lt;br /&gt;
	vfirstname=firstname&lt;br /&gt;
	vage=age&lt;br /&gt;
	vaddress=address&lt;br /&gt;
&lt;br /&gt;
	@1.1 say "enter lastname :  " get vlatname vfirstname&lt;br /&gt;
	@2.1 say "enter firstname : " get vfirstname&lt;br /&gt;
	@3.1 say "enter address : "get vaddress&lt;br /&gt;
	&lt;br /&gt;
	read&lt;br /&gt;
	wait window "do you want to save (y/n)? "to nans  &lt;br /&gt;
	if nans $ "Yy"&lt;br /&gt;
	replace lastname with vlastname, firstname with vfirstname, address with vaddress&lt;br /&gt;
else &lt;br /&gt;
	wait window "record not save"&lt;br /&gt;
and if&lt;br /&gt;
else&lt;br /&gt;
	wait window "record is not found!......."&lt;br /&gt;
and if&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
*---------------procedure for deleting record--------------------------------------------------*&lt;br /&gt;
&lt;br /&gt;
procedure _deleterec	&lt;br /&gt;
set index to enrolist2&lt;br /&gt;
vlastname=space(15)&lt;br /&gt;
vfirstname=space(15)&lt;br /&gt;
@1.1  say "enter lastname to edit : "get vlastname"&lt;br /&gt;
@2.1  say "enter vfirstname to edit : "get vfirstname"&lt;br /&gt;
read&lt;br /&gt;
*locate for lastname=vlastname&lt;br /&gt;
seek for lastname for vfirstname&lt;br /&gt;
if found ()&lt;br /&gt;
	nans=" "&lt;br /&gt;
	delete&lt;br /&gt;
	wait window "record is deleted!............"&lt;br /&gt;
and if&lt;br /&gt;
else&lt;br /&gt;
	wait window "totally remove the deleted record(y/n)? ""to nans  &lt;br /&gt;
if nans $ "Yy" &lt;br /&gt;
	pack &lt;br /&gt;
	wait window "record is deleted!............"&lt;br /&gt;
else&lt;br /&gt;
	wait window "record is mark only for deletion......."	&lt;br /&gt;
and if &lt;br /&gt;
else&lt;br /&gt;
wait window "record is not found!......."&lt;br /&gt;
and if&lt;br /&gt;
return	&lt;br /&gt;</description>
      <pubDate>Sun, 24 Aug 2008 08:26:16 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>VBA Excel Macro for 'n x n' Matrix formation based on user inputs??</title>
      <link>http://www.programmersheaven.com/mb/vba/374378/374378/vba-excel-macro-for-n-x-n-matrix-formation-based-on-user-inputs/</link>
      <description>Dear All,&lt;br /&gt;
			&lt;br /&gt;
Can somebody help me out in generating a macro for forming a "n x n" matrix based on user inputs. - Excel sheet enclosed. Send me ur replies to reachspk@gmail.com :)			&lt;br /&gt;
Inputs:			&lt;br /&gt;
			&lt;br /&gt;
i	j	Value	&lt;br /&gt;
			&lt;br /&gt;
1	2	1	&lt;br /&gt;
1	3	1	&lt;br /&gt;
1	4	-1	&lt;br /&gt;
1	8	-1	&lt;br /&gt;
2	1	1	&lt;br /&gt;
2	4	1	&lt;br /&gt;
2	5	-1	&lt;br /&gt;
2	6	-1	&lt;br /&gt;
3	5	1	&lt;br /&gt;
3	6	1	&lt;br /&gt;
3	7	-1	&lt;br /&gt;
4	1	130.1459226	&lt;br /&gt;
4	4	-160.8272092	&lt;br /&gt;
4	2	-144.5355421	&lt;br /&gt;
5	2	144.5355421	&lt;br /&gt;
5	3	-183.6928125	&lt;br /&gt;
6	2	144.5355421	&lt;br /&gt;
6	4	160.8272092	&lt;br /&gt;
6	5	137.3575476	&lt;br /&gt;
6	7	152.8315505	&lt;br /&gt;
7	2	144.5355421	&lt;br /&gt;
7	4	160.8272092	&lt;br /&gt;
7	6	137.3575476	&lt;br /&gt;
7	7	152.8315505	&lt;br /&gt;
8	3	183.6928125	&lt;br /&gt;
8	8	172.7183057	&lt;br /&gt;
&lt;br /&gt;
In remaining locations, values are zero.&lt;br /&gt;
&lt;br /&gt;
i	j	Value	&lt;br /&gt;
1	1	0	&lt;br /&gt;
1	5	0	etc.,&lt;br /&gt;
&lt;br /&gt;
Here, we have 8x8 matrix. But, this should be generalized for forming "n x n" matrix								&lt;br /&gt;
								&lt;br /&gt;
								&lt;br /&gt;
	Please get me an Excel Macro for this.							&lt;br /&gt;
Thanks in advance,&lt;br /&gt;
Prakash&lt;br /&gt;
&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=189"&gt;Matrix_formation_Inputs.xls&lt;/a&gt; (37888 bytes | downloaded 75 times)</description>
      <pubDate>Thu, 21 Aug 2008 12:02:17 -0700</pubDate>
      <category>VBA</category>
    </item>
  </channel>
</rss>