<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>VBForums - Office Development</title>
		<link>http://www.vbforums.com/</link>
		<description>Post all your questions here regarding Microsoft Office Automation. This can include VSTO, VSTA, and VBA questions.</description>
		<language>en</language>
		<lastBuildDate>Sun, 19 May 2013 08:57:28 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.vbforums.com/images/misc/rss.png</url>
			<title>VBForums - Office Development</title>
			<link>http://www.vbforums.com/</link>
		</image>
		<item>
			<title>Dilemma with Using a Form and textbox with Access</title>
			<link>http://www.vbforums.com/showthread.php?722119-Dilemma-with-Using-a-Form-and-textbox-with-Access&amp;goto=newpost</link>
			<pubDate>Sat, 18 May 2013 17:35:05 GMT</pubDate>
			<description><![CDATA[I think this is the right forum since the question is db related really. 
I had to build this app in Access, because that is the only thing I'm allowed to code in at the office.

I created a form and put some labels and textboxes on it. One box is txtNotes, where I put notes on particular records (yes they are coming from the db, but the question is more about the object).  Initially, I wanted to have a vertical scrollbar on this large text box, so that when the note was too large, the user could scroll down.  I found that on the Access Form, the textbox has to have focus to show the scrollbar.  That was fine.  I set focus to it as the last step each time.  

Then I encountered a new issue.  I was using txtNotes.Text = RS("notes") and eventually, one of my notes was too long and I got an error telling me so.  To fix this, I switched from txtNotes.Text to txtNotes.Value.  That solved the "too long" problem, but created a new problem.  Now when .SetFocus kicks in, the entire contents of the box is highlighted.

So the problem is, if I don't Set Focus, then I don't get scrollbars.  If I do set focus, then my text gets highlighted.  I could set .Value back to .text, but then some of my notes will be too long.  (BTW, what is the limit, I haven't found it anywhere).

So that's it.  Suggestions? 
I should mention that the text in the box is a mix of English and Chinese, so any ideas that involve counting characters and acting accordingly will be hard to implement with any accuracy.

Thanks.]]></description>
			<content:encoded><![CDATA[<div>I think this is the right forum since the question is db related really. <br />
I had to build this app in Access, because that is the only thing I'm allowed to code in at the office.<br />
<br />
I created a form and put some labels and textboxes on it. One box is txtNotes, where I put notes on particular records (yes they are coming from the db, but the question is more about the object).  Initially, I wanted to have a vertical scrollbar on this large text box, so that when the note was too large, the user could scroll down.  I found that on the Access Form, the textbox has to have focus to show the scrollbar.  That was fine.  I set focus to it as the last step each time.  <br />
<br />
Then I encountered a new issue.  I was using txtNotes.Text = RS(&quot;notes&quot;) and eventually, one of my notes was too long and I got an error telling me so.  To fix this, I switched from txtNotes.Text to txtNotes.Value.  That solved the &quot;too long&quot; problem, but created a new problem.  Now when .SetFocus kicks in, the entire contents of the box is highlighted.<br />
<br />
So the problem is, if I don't Set Focus, then I don't get scrollbars.  If I do set focus, then my text gets highlighted.  I could set .Value back to .text, but then some of my notes will be too long.  (BTW, what is the limit, I haven't found it anywhere).<br />
<br />
So that's it.  Suggestions? <br />
I should mention that the text in the box is a mix of English and Chinese, so any ideas that involve counting characters and acting accordingly will be hard to implement with any accuracy.<br />
<br />
Thanks.</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>wengang</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?722119-Dilemma-with-Using-a-Form-and-textbox-with-Access</guid>
		</item>
		<item>
			<title><![CDATA[MsOf10 [RESOLVED] [Access] Importing csv files into Access through VBA]]></title>
			<link>http://www.vbforums.com/showthread.php?722027-RESOLVED-Access-Importing-csv-files-into-Access-through-VBA&amp;goto=newpost</link>
			<pubDate>Fri, 17 May 2013 18:05:10 GMT</pubDate>
			<description><![CDATA[Hello everyone,

I swear I'm going crazy.  I have an import specification for csv files which, when I run it on a file through the GUI, works just fine.  However, when I run it through VBA, for some reason it forgets that one column is supposed to be a Text column and makes it a Number column instead, thereby causing tons of errors.

My code is below.  It *works* in the sense that everything runs properly, but for some reason the import specification for the CSVs does not run properly.  The meaningless case switch is a place holder, as I will need to add more types of reports after I get the first working.


Code:
---------
Sub ImportDE(Folder As Object)
    Dim db As DAO.Database
    Dim names As DAO.Recordset
    Dim Files As Object, file As Object, SubFolders As Object, subfolder As Object
    Dim ExString As Variant
    Dim check As Boolean
    Dim FileChange As String

    Set db = CurrentDb
    On Error Resume Next:   db.TableDefs.Delete "tblImport":   On Error GoTo 0
    db.TableDefs.Refresh
    
    Set names = CurrentDb.OpenRecordset("SELECT Old FROM DENames")
    
    Set Files = Folder.Files
    Set SubFolders = Folder.SubFolders

    For Each subfolder In SubFolders
        ImportDE subfolder
    Next
    
    With names
        Do While Not .EOF
            ExString = .Fields(0)
            For Each file In Files
                If InStr(file.Type, "Worksheet") > 0 Then
                    If InStr(file.Path, ExString & ".xls") > 0 Then
                        DoCmd.TransferSpreadsheet _
                            TransferType:=acImport, _
                            SpreadsheetType:=acSpreadsheetTypeExcel9, _
                            TableName:="tblImport_" & ExString, _
                            filename:=file.Path, _
                            HasFieldNames:=True, _
                            Range:="A:CT"
                        db.TableDefs.Refresh
                    End If
                ElseIf InStr(file.Type, "Comma Separated") > 0 Then
                    If InStr(file.Path, ExString & ".csv") > 0 Then
                        Select Case ExString
                        Case "Usage"
                            DoCmd.TransferText _
                                TransferType:=acImportDelim, _
                                SpecificationName:=UsageCSV, _
                                TableName:="tblImport_" & ExString, _
                                filename:=file.Path, _
                                HasFieldNames:=True
                            db.TableDefs.Refresh
                        End Select
                    End If
                End If
            Next
            .MoveNext
        Loop
    End With
    db.Close:   Set db = Nothing
End Sub
---------
EDIT:  For posterity, the answer is that I did not enclose the specification in quotation marks.  It should be "UsageCSV".]]></description>
			<content:encoded><![CDATA[<div>Hello everyone,<br />
<br />
I swear I'm going crazy.  I have an import specification for csv files which, when I run it on a file through the GUI, works just fine.  However, when I run it through VBA, for some reason it forgets that one column is supposed to be a Text column and makes it a Number column instead, thereby causing tons of errors.<br />
<br />
My code is below.  It *works* in the sense that everything runs properly, but for some reason the import specification for the CSVs does not run properly.  The meaningless case switch is a place holder, as I will need to add more types of reports after I get the first working.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Sub ImportDE(Folder As Object)<br />
&nbsp; &nbsp; Dim db As DAO.Database<br />
&nbsp; &nbsp; Dim names As DAO.Recordset<br />
&nbsp; &nbsp; Dim Files As Object, file As Object, SubFolders As Object, subfolder As Object<br />
&nbsp; &nbsp; Dim ExString As Variant<br />
&nbsp; &nbsp; Dim check As Boolean<br />
&nbsp; &nbsp; Dim FileChange As String<br />
<br />
&nbsp; &nbsp; Set db = CurrentDb<br />
&nbsp; &nbsp; On Error Resume Next:&nbsp;  db.TableDefs.Delete &quot;tblImport&quot;:&nbsp;  On Error GoTo 0<br />
&nbsp; &nbsp; db.TableDefs.Refresh<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Set names = CurrentDb.OpenRecordset(&quot;SELECT Old FROM DENames&quot;)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Set Files = Folder.Files<br />
&nbsp; &nbsp; Set SubFolders = Folder.SubFolders<br />
<br />
&nbsp; &nbsp; For Each subfolder In SubFolders<br />
&nbsp; &nbsp; &nbsp; &nbsp; ImportDE subfolder<br />
&nbsp; &nbsp; Next<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; With names<br />
&nbsp; &nbsp; &nbsp; &nbsp; Do While Not .EOF<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ExString = .Fields(0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For Each file In Files<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If InStr(file.Type, &quot;Worksheet&quot;) &gt; 0 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If InStr(file.Path, ExString &amp; &quot;.xls&quot;) &gt; 0 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DoCmd.TransferSpreadsheet _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TransferType:=acImport, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SpreadsheetType:=acSpreadsheetTypeExcel9, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TableName:=&quot;tblImport_&quot; &amp; ExString, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; filename:=file.Path, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HasFieldNames:=True, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Range:=&quot;A:CT&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.TableDefs.Refresh<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ElseIf InStr(file.Type, &quot;Comma Separated&quot;) &gt; 0 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If InStr(file.Path, ExString &amp; &quot;.csv&quot;) &gt; 0 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Select Case ExString<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Case &quot;Usage&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DoCmd.TransferText _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TransferType:=acImportDelim, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SpecificationName:=UsageCSV, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TableName:=&quot;tblImport_&quot; &amp; ExString, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; filename:=file.Path, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HasFieldNames:=True<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.TableDefs.Refresh<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End Select<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Next<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .MoveNext<br />
&nbsp; &nbsp; &nbsp; &nbsp; Loop<br />
&nbsp; &nbsp; End With<br />
&nbsp; &nbsp; db.Close:&nbsp;  Set db = Nothing<br />
End Sub</code><hr />
</div>EDIT:  For posterity, the answer is that I did not enclose the specification in quotation marks.  It should be &quot;UsageCSV&quot;.</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>setsanto</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?722027-RESOLVED-Access-Importing-csv-files-into-Access-through-VBA</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] How to pop up find box in Word with VB code?]]></title>
			<link>http://www.vbforums.com/showthread.php?721913-RESOLVED-How-to-pop-up-find-box-in-Word-with-VB-code&amp;goto=newpost</link>
			<pubDate>Thu, 16 May 2013 17:14:43 GMT</pubDate>
			<description>How can I make pop up the find box avalaible manually through Edit / Find... under Word 2003 and stay there for further manual input? Is there some special command in With Selection.Find etc.?</description>
			<content:encoded><![CDATA[<div>How can I make pop up the find box avalaible manually through Edit / Find... under Word 2003 and stay there for further manual input? Is there some special command in With Selection.Find etc.?</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>Huldrich</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721913-RESOLVED-How-to-pop-up-find-box-in-Word-with-VB-code</guid>
		</item>
		<item>
			<title>Inserting HTML code (chart) into Excel spreadsheet.</title>
			<link>http://www.vbforums.com/showthread.php?721897-Inserting-HTML-code-(chart)-into-Excel-spreadsheet&amp;goto=newpost</link>
			<pubDate>Thu, 16 May 2013 15:17:20 GMT</pubDate>
			<description><![CDATA[Hello,

The HTML code below references a plot that is updated regularly... does anyone know how I can post the code into an Excel spreadsheet (MS Office 2010) to show the chart?  Each time I open the spreadsheet, the chart would appear and be updated.   

I have limited VBA familiarity ... would I need to use VBA code to insert?  Any suggestions appreciated.  Thanks so much.

Don

<table width=180 border=0 cellspacing=0 cellpadding=0 bgcolor=#FFFFFF><tr><td>
<A HREF="http://www.kitcometals.com/connecting.html">
<IMG SRC="http://www.kitconet.com/charts/metals/base/copper-d.gif" BORDER="0" ALT="[Most Recent Quotes from www.kitco.com]">
</A></td></tr></table>]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
The HTML code below references a plot that is updated regularly... does anyone know how I can post the code into an Excel spreadsheet (MS Office 2010) to show the chart?  Each time I open the spreadsheet, the chart would appear and be updated.   <br />
<br />
I have limited VBA familiarity ... would I need to use VBA code to insert?  Any suggestions appreciated.  Thanks so much.<br />
<br />
Don<br />
<br />
&lt;table width=180 border=0 cellspacing=0 cellpadding=0 bgcolor=#FFFFFF&gt;&lt;tr&gt;&lt;td&gt;<br />
&lt;A HREF=&quot;http://www.kitcometals.com/connecting.html&quot;&gt;<br />
&lt;IMG SRC=&quot;http://www.kitconet.com/charts/metals/base/copper-d.gif&quot; BORDER=&quot;0&quot; ALT=&quot;[Most Recent Quotes from www.kitco.com]&quot;&gt;<br />
&lt;/A&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>umbata</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721897-Inserting-HTML-code-(chart)-into-Excel-spreadsheet</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] Limiting User's Interaction with Excel]]></title>
			<link>http://www.vbforums.com/showthread.php?721895-RESOLVED-Limiting-User-s-Interaction-with-Excel&amp;goto=newpost</link>
			<pubDate>Thu, 16 May 2013 15:02:14 GMT</pubDate>
			<description><![CDATA[I am writing a simple application which reads data from a GPS unit and stores the coordinates in a file. I am a novice when it comes to Excel automation and VB and am learning bit by bit how to do this! I have succeeded so far in writing a list of values into a column and after much "exception throwing" when an attempt is made to edit a cell, I set the interactive property of the Excel object to false to prevent any changes being made. This works fine but unfortunately this disables all interaction, so  is it possible to prevent interaction with the cells of a worksheet but allow a user to scroll down through data (when this extends beyond the screen) ? I have tried to use the protect method and lock the cells in code, but this just causes Excel to complain about the sheet being protected and VB throws an exception.]]></description>
			<content:encoded><![CDATA[<div>I am writing a simple application which reads data from a GPS unit and stores the coordinates in a file. I am a novice when it comes to Excel automation and VB and am learning bit by bit how to do this! I have succeeded so far in writing a list of values into a column and after much &quot;exception throwing&quot; when an attempt is made to edit a cell, I set the interactive property of the Excel object to false to prevent any changes being made. This works fine but unfortunately this disables all interaction, so  is it possible to prevent interaction with the cells of a worksheet but allow a user to scroll down through data (when this extends beyond the screen) ? I have tried to use the protect method and lock the cells in code, but this just causes Excel to complain about the sheet being protected and VB throws an exception.</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>Eugbug</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721895-RESOLVED-Limiting-User-s-Interaction-with-Excel</guid>
		</item>
		<item>
			<title>MsOf10 Simple Array Script help</title>
			<link>http://www.vbforums.com/showthread.php?721763-Simple-Array-Script-help&amp;goto=newpost</link>
			<pubDate>Wed, 15 May 2013 16:46:12 GMT</pubDate>
			<description><![CDATA[Hi there

Just need to insert 19 different arrays into my script, but still having trouble. Its unique serial numbers with a name to each.


Code:
---------
SALGA = Array("0301/4535/0000", "0550/4535/0000") 'Salga
        
        Sec = Array("0301/4213/0000", "0550/4213/0000", "0700/4213/0000")
        
        TarW = Array("0101/4515/0000", "0401/4515/0000") 'Target Women
        
        TarY = Array("0003/4517/0000", "0401/4517/0000") 'Target Youth
        
        Train = Array("0211/4523/0000", "0501/4523/0000") 'Training
---------
And i want to insert them into this:


Code:
---------
                 myAry = Array("0003/3857/0000", "0101/3857/0000", "0201/3857/0000", "0301/3857/0000", "0401/3857/0000", _
                "0550/3857/0000", "0601/3857/0000", "0700/3857/0000", "0003/6063/0000", "0101/6063/0000", "0201/6063/0000", _
                "0301/6063/0000", "0401/6063/0000", "0550/6063/0000", "0601/6063/0000", "0700/6063/0000")
            For i = LBound(myAry) To UBound(myAry)
            If Range("B" & RowNumbr) = myAry(i) Then
                Qs = MsgBox("The current vote you created is allocated on Vehicle. Is This Correct?", _
                    vbYesNo + vbQuestion, "VALIDATE")
                If Qs = vbNo Then
                    Range("C" & RowNumbr) = "No"
            ElseIf Qs = vbYes Then
            Range("C" & RowNumbr) = "Yes"
        End If
    Exit For
End If
    If i = UBound(myAry) Then MsgBox "Vote Number Not found", vbCritical, "WARNING"
Next
---------
This code works perfectly. My aim is to let the user insert the serial number via input box, then this code should run and display under which name it falls, and then display the name of the serial number, followed by an interaction with the MsgBox commands as seen in the example above. Then when no values are found, it should display the last message in the above script.. 

Is there any advise? I am very new to VBA scripts]]></description>
			<content:encoded><![CDATA[<div>Hi there<br />
<br />
Just need to insert 19 different arrays into my script, but still having trouble. Its unique serial numbers with a name to each.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">SALGA = Array(&quot;0301/4535/0000&quot;, &quot;0550/4535/0000&quot;) 'Salga<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Sec = Array(&quot;0301/4213/0000&quot;, &quot;0550/4213/0000&quot;, &quot;0700/4213/0000&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; TarW = Array(&quot;0101/4515/0000&quot;, &quot;0401/4515/0000&quot;) 'Target Women<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; TarY = Array(&quot;0003/4517/0000&quot;, &quot;0401/4517/0000&quot;) 'Target Youth<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Train = Array(&quot;0211/4523/0000&quot;, &quot;0501/4523/0000&quot;) 'Training</code><hr />
</div>And i want to insert them into this:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  myAry = Array(&quot;0003/3857/0000&quot;, &quot;0101/3857/0000&quot;, &quot;0201/3857/0000&quot;, &quot;0301/3857/0000&quot;, &quot;0401/3857/0000&quot;, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;0550/3857/0000&quot;, &quot;0601/3857/0000&quot;, &quot;0700/3857/0000&quot;, &quot;0003/6063/0000&quot;, &quot;0101/6063/0000&quot;, &quot;0201/6063/0000&quot;, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;0301/6063/0000&quot;, &quot;0401/6063/0000&quot;, &quot;0550/6063/0000&quot;, &quot;0601/6063/0000&quot;, &quot;0700/6063/0000&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For i = LBound(myAry) To UBound(myAry)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Range(&quot;B&quot; &amp; RowNumbr) = myAry(i) Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Qs = MsgBox(&quot;The current vote you created is allocated on Vehicle. Is This Correct?&quot;, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vbYesNo + vbQuestion, &quot;VALIDATE&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Qs = vbNo Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Range(&quot;C&quot; &amp; RowNumbr) = &quot;No&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ElseIf Qs = vbYes Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Range(&quot;C&quot; &amp; RowNumbr) = &quot;Yes&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; Exit For<br />
End If<br />
&nbsp; &nbsp; If i = UBound(myAry) Then MsgBox &quot;Vote Number Not found&quot;, vbCritical, &quot;WARNING&quot;<br />
Next</code><hr />
</div>This code works perfectly. My aim is to let the user insert the serial number via input box, then this code should run and display under which name it falls, and then display the name of the serial number, followed by an interaction with the MsgBox commands as seen in the example above. Then when no values are found, it should display the last message in the above script.. <br />
<br />
Is there any advise? I am very new to VBA scripts</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>Surfboard</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721763-Simple-Array-Script-help</guid>
		</item>
		<item>
			<title><![CDATA[[Excel] VBA and Registry Windows 7 Pro 64 bit.. a trick I am missing.]]></title>
			<link>http://www.vbforums.com/showthread.php?721751-Excel-VBA-and-Registry-Windows-7-Pro-64-bit-a-trick-I-am-missing&amp;goto=newpost</link>
			<pubDate>Wed, 15 May 2013 14:55:04 GMT</pubDate>
			<description><![CDATA[I manage a few kiosk style machines, network restricted and with all the protections we can heap on them.. well, they are all autologon, so have a user name and password in the registry.  Unders windows XP I had no problem with reading the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon and the sub keys DefaultUserName and Default Password. and then even writing back a new password from my Excel list of machine and accounts.. but I have discovered that even though I read the above key, it seems that the StdRegProv is actually reading HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon..  and even on the Windows 7 machines, the values in use are in the first location.

The code I am using, right now just to read the values, is:

Const HKEY_LOCAL_MACHINE = &H80000002
Defpwd = "DefaultPassword"
Defname = "DefaultUserName"
On Error Resume Next
For a = 2 To 501
   Cells(1, 12) = a
   strhostname = Cells(a, 1).Value
   Debug.Print strhostname
   Call ResolveIP(strhostname)
   If strhostname <> "Unreachable" Then
      strhostname = Cells(a, 1).Value
      Set objReg = GetObject("winmgmts:\\" & strhostname & "\root\default:StdRegProv")
      strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
      objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, Defpwd, strValue1
      Debug.Print strValue1
      objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, Defname, strValue2
      Debug.Print strValue2
      Cells(a, 8).Value = strValue1
      Cells(a, 9).Value = strValue2
      strValue1 = ""
      strValue2 = ""
      Else: Cells(a, 8) = "Unreachable"
      End If
   Next a

It actually specifies the correct location, but in Windows 7 it defaults to the second location.  I am reasonably sure of this as I have gone in with Regedit and applied the settings to the WOW6432Node location and then this existing script "finds" the values.  But changing the password in the Wow6432Node location does not get the password applied to the location that is read out in the autologon operation.

Anyone have any idea on how to get it to read out the right set of keys?

I have tried a lot of code pieces I have found on the internet, and so far they don't get me where I need to be.]]></description>
			<content:encoded><![CDATA[<div>I manage a few kiosk style machines, network restricted and with all the protections we can heap on them.. well, they are all autologon, so have a user name and password in the registry.  Unders windows XP I had no problem with reading the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon and the sub keys DefaultUserName and Default Password. and then even writing back a new password from my Excel list of machine and accounts.. but I have discovered that even though I read the above key, it seems that the StdRegProv is actually reading HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon..  and even on the Windows 7 machines, the values in use are in the first location.<br />
<br />
The code I am using, right now just to read the values, is:<br />
<br />
Const HKEY_LOCAL_MACHINE = &amp;H80000002<br />
Defpwd = &quot;DefaultPassword&quot;<br />
Defname = &quot;DefaultUserName&quot;<br />
On Error Resume Next<br />
For a = 2 To 501<br />
   Cells(1, 12) = a<br />
   strhostname = Cells(a, 1).Value<br />
   Debug.Print strhostname<br />
   Call ResolveIP(strhostname)<br />
   If strhostname &lt;&gt; &quot;Unreachable&quot; Then<br />
      strhostname = Cells(a, 1).Value<br />
      Set objReg = GetObject(&quot;winmgmts:\\&quot; &amp; strhostname &amp; &quot;\root\default:StdRegProv&quot;)<br />
      strKeyPath = &quot;SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon&quot;<br />
      objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, Defpwd, strValue1<br />
      Debug.Print strValue1<br />
      objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, Defname, strValue2<br />
      Debug.Print strValue2<br />
      Cells(a, 8).Value = strValue1<br />
      Cells(a, 9).Value = strValue2<br />
      strValue1 = &quot;&quot;<br />
      strValue2 = &quot;&quot;<br />
      Else: Cells(a, 8) = &quot;Unreachable&quot;<br />
      End If<br />
   Next a<br />
<br />
It actually specifies the correct location, but in Windows 7 it defaults to the second location.  I am reasonably sure of this as I have gone in with Regedit and applied the settings to the WOW6432Node location and then this existing script &quot;finds&quot; the values.  But changing the password in the Wow6432Node location does not get the password applied to the location that is read out in the autologon operation.<br />
<br />
Anyone have any idea on how to get it to read out the right set of keys?<br />
<br />
I have tried a lot of code pieces I have found on the internet, and so far they don't get me where I need to be.</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>Putertechn</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721751-Excel-VBA-and-Registry-Windows-7-Pro-64-bit-a-trick-I-am-missing</guid>
		</item>
		<item>
			<title>Automated Emails</title>
			<link>http://www.vbforums.com/showthread.php?721717-Automated-Emails&amp;goto=newpost</link>
			<pubDate>Wed, 15 May 2013 09:43:45 GMT</pubDate>
			<description><![CDATA[Okay total Noob here so please bare with me.
I used this video to write what I’ve got.
http://www.youtube.com/watch?v=Z-hsCUl1qW8

I’m trying to send email notifications, only once, if J14 = <7.0, then stop the emails.
And then wait for J14 = >6.9, send another email, stop emails and wait for J14 to = <7.0 again.
Right now it just keeps emailing every 20 minutes when J14 is updated by a web query.

Any help would be greatly appreciated.
Thanks

Here’s what I’ve got.
==============================================================
Private Sub Worksheet_Calculate()

Control1 = Range("I11").Value

Trigger = Range("J11").Value

HighestRecordedPeriod = Range("J14").Select
If HighestRecordedPeriod < Trigger And Control1 = "MAIL" Then

Dim ADDRESS As String, SUBJECT As String
Dim BODY As String, HYPER As String

ADDRESS = "myaddress@hotmail.com"
SUBJECT = "This is an Alert - The period has reached " & Range("J14") & " seconds"
BODY = "test"

HYPER = "mailto:" & ADDRESS & "?Subject=" & SUBJECT

ActiveWorkbook.FollowHyperlink (HYPER)
Application.Wait (Now + TimeValue("0:00:15"))
Application.SendKeys "%S"

Range("I11").Select
ActiveCell.FormulaR1C1 = "MAIL"

End If
End Sub]]></description>
			<content:encoded><![CDATA[<div>Okay total Noob here so please bare with me.<br />
I used this video to write what I’ve got.<br />
<a rel="nofollow" href="http://www.youtube.com/watch?v=Z-hsCUl1qW8" target="_blank">http://www.youtube.com/watch?v=Z-hsCUl1qW8</a><br />
<br />
I’m trying to send email notifications, only once, if J14 = &lt;7.0, then stop the emails.<br />
And then wait for J14 = &gt;6.9, send another email, stop emails and wait for J14 to = &lt;7.0 again.<br />
Right now it just keeps emailing every 20 minutes when J14 is updated by a web query.<br />
<br />
Any help would be greatly appreciated.<br />
Thanks<br />
<br />
Here’s what I’ve got.<br />
==============================================================<br />
Private Sub Worksheet_Calculate()<br />
<br />
Control1 = Range(&quot;I11&quot;).Value<br />
<br />
Trigger = Range(&quot;J11&quot;).Value<br />
<br />
HighestRecordedPeriod = Range(&quot;J14&quot;).Select<br />
If HighestRecordedPeriod &lt; Trigger And Control1 = &quot;MAIL&quot; Then<br />
<br />
Dim ADDRESS As String, SUBJECT As String<br />
Dim BODY As String, HYPER As String<br />
<br />
ADDRESS = &quot;myaddress@hotmail.com&quot;<br />
SUBJECT = &quot;This is an Alert - The period has reached &quot; &amp; Range(&quot;J14&quot;) &amp; &quot; seconds&quot;<br />
BODY = &quot;test&quot;<br />
<br />
HYPER = &quot;mailto:&quot; &amp; ADDRESS &amp; &quot;?Subject=&quot; &amp; SUBJECT<br />
<br />
ActiveWorkbook.FollowHyperlink (HYPER)<br />
Application.Wait (Now + TimeValue(&quot;0:00:15&quot;))<br />
Application.SendKeys &quot;%S&quot;<br />
<br />
Range(&quot;I11&quot;).Select<br />
ActiveCell.FormulaR1C1 = &quot;MAIL&quot;<br />
<br />
End If<br />
End Sub</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>naminori</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721717-Automated-Emails</guid>
		</item>
		<item>
			<title><![CDATA[Excel (mac) macro redirect to webpage extremely slow > HUH?!]]></title>
			<link>http://www.vbforums.com/showthread.php?721505-Excel-(mac)-macro-redirect-to-webpage-extremely-slow-gt-HUH-!&amp;goto=newpost</link>
			<pubDate>Mon, 13 May 2013 17:26:13 GMT</pubDate>
			<description><![CDATA[Dear Experts,

I am running into an extremely annoying and strange problem. I hope someone can help me out with this, it drives me crazy by now! :s

I have the following macro:


Code:
---------
Sub StuurNaarBoekhouding()

'Are you sure?
Antwoord = MsgBox("Sure?", vbOKCancel + vbExclamation, "WATCH IT!")
If Antwoord = vbCancel Then Exit Sub

'workbook save
ThisWorkbook.Save

'get modified date
Dim sLMD As String
    On Error Resume Next
    sLMD = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
    If Err = 440 Then
        Err = 0
        sLMD = "0"
        ' not found so ask to save
        MsgBox "Not saved yet. Save it first.", vbOKOnly + vbCritical
        Exit Sub
    End If

'get filename
filelocation = ActiveWorkbook.FullName

'get extra info for url
Dim kostenplaats As String
kostenplaats = Worksheets("SHEETX").Range("C9:C9").Value
If kostenplaats = "" Then
    MsgBox "The extra value for the url is not set, fill in first.", vbOKOnly + vbCritical
    Exit Sub
End If

'create s code
Dim s As String
s = "coded_string_for_security_reasons"

'the url base
Dim url As String
url = "http://www.website.com/"

'UNTIL HERE, THE CODE WORKS FAST AS LIGHTING (tested by throwing an msgbox here)
'THE STEP DOWN HERE TAKES TWO (!!) MINUTES

'send to url
ActiveWorkbook.FollowHyperlink Address:=url + "?code=" + s + "&last_changed=" + sLMD + "&extra_info=" + kostenplaats + "&p=" + filelocation

'workbook save without saving again (so that saved last time info doesnt change)
ActiveWorkbook.Saved = True
ActiveWorkbook.Close SaveChanges:=False
End Sub
---------
Now on windows, this piece of code works perfect. But on my mac (osx 10.8.3) office excel 2011 it does work, but the 'followhyperlink'-step takes 120 (!!) seconds to execute. This is extremely slow (on the windows it takes only 0.5 seconds or so).

What happens? How can I solve this problem?

I really hope that someone can help me out. Would be very very much appreciated!

S]]></description>
			<content:encoded><![CDATA[<div>Dear Experts,<br />
<br />
I am running into an extremely annoying and strange problem. I hope someone can help me out with this, it drives me crazy by now! :s<br />
<br />
I have the following macro:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Sub StuurNaarBoekhouding()<br />
<br />
'Are you sure?<br />
Antwoord = MsgBox(&quot;Sure?&quot;, vbOKCancel + vbExclamation, &quot;WATCH IT!&quot;)<br />
If Antwoord = vbCancel Then Exit Sub<br />
<br />
'workbook save<br />
ThisWorkbook.Save<br />
<br />
'get modified date<br />
Dim sLMD As String<br />
&nbsp; &nbsp; On Error Resume Next<br />
&nbsp; &nbsp; sLMD = ActiveWorkbook.BuiltinDocumentProperties(&quot;Last Save Time&quot;)<br />
&nbsp; &nbsp; If Err = 440 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Err = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; sLMD = &quot;0&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ' not found so ask to save<br />
&nbsp; &nbsp; &nbsp; &nbsp; MsgBox &quot;Not saved yet. Save it first.&quot;, vbOKOnly + vbCritical<br />
&nbsp; &nbsp; &nbsp; &nbsp; Exit Sub<br />
&nbsp; &nbsp; End If<br />
<br />
'get filename<br />
filelocation = ActiveWorkbook.FullName<br />
<br />
'get extra info for url<br />
Dim kostenplaats As String<br />
kostenplaats = Worksheets(&quot;SHEETX&quot;).Range(&quot;C9:C9&quot;).Value<br />
If kostenplaats = &quot;&quot; Then<br />
&nbsp; &nbsp; MsgBox &quot;The extra value for the url is not set, fill in first.&quot;, vbOKOnly + vbCritical<br />
&nbsp; &nbsp; Exit Sub<br />
End If<br />
<br />
'create s code<br />
Dim s As String<br />
s = &quot;coded_string_for_security_reasons&quot;<br />
<br />
'the url base<br />
Dim url As String<br />
url = &quot;http://www.website.com/&quot;<br />
<br />
'UNTIL HERE, THE CODE WORKS FAST AS LIGHTING (tested by throwing an msgbox here)<br />
'THE STEP DOWN HERE TAKES TWO (!!) MINUTES<br />
<br />
'send to url<br />
ActiveWorkbook.FollowHyperlink Address:=url + &quot;?code=&quot; + s + &quot;&amp;last_changed=&quot; + sLMD + &quot;&amp;extra_info=&quot; + kostenplaats + &quot;&amp;p=&quot; + filelocation<br />
<br />
'workbook save without saving again (so that saved last time info doesnt change)<br />
ActiveWorkbook.Saved = True<br />
ActiveWorkbook.Close SaveChanges:=False<br />
End Sub</code><hr />
</div>Now on windows, this piece of code works perfect. But on my mac (osx 10.8.3) office excel 2011 it does work, but the 'followhyperlink'-step takes 120 (!!) seconds to execute. This is extremely slow (on the windows it takes only 0.5 seconds or so).<br />
<br />
What happens? How can I solve this problem?<br />
<br />
I really hope that someone can help me out. Would be very very much appreciated!<br />
<br />
S</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>PeterJKorst</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721505-Excel-(mac)-macro-redirect-to-webpage-extremely-slow-gt-HUH-!</guid>
		</item>
		<item>
			<title>Using CTPFactory and CTPFactoryAvailable methods to interact with the ribbon UI</title>
			<link>http://www.vbforums.com/showthread.php?721437-Using-CTPFactory-and-CTPFactoryAvailable-methods-to-interact-with-the-ribbon-UI&amp;goto=newpost</link>
			<pubDate>Mon, 13 May 2013 06:19:22 GMT</pubDate>
			<description><![CDATA[Hi

I am using NetOffice and Visual Studio 2010 Express to develop word COM addins.

Very simple I want to show a custom task pane (CTP) when a check box is ticked in the ribbon UI.

NetOffice cannot directly using the standard custom task pane objects that are available in the visual studio express. It has to rely on CTPFactoryAvailable method to show the CTP.

The following example shows the CTP upon loading up word however I cannot make it more dynamic to only show the CTP when the checkbox is ticked.

Does anyone have any ideas?

Adding the ICustomTaskPaneConsumer to the Implements 
Office.ICustomTaskPaneConsumer 

And use the CTPFactoryAvailable sub to create the custom task pane. 

Public Sub CTPFactoryAvailable(ByVal CTPFactoryInst As Object) Implements NetOffice.OfficeApi.ICustomTaskPaneConsumer.CTPFactoryAvailable
        Dim ctpFactory As Office.ICTPFactory = New Office.ICTPFactory(_wordApplication, CTPFactoryInst)
        Dim taskPane As Office._CustomTaskPane = ctpFactory.CreateCTP(GetType(Addin).Assembly.GetName().Name + ".SampleControl", "NetOffice Sample Pane(VB4)", Type.Missing)
        taskPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionLeft
        taskPane.Width = 300
        taskPane.Visible = True
        _sampleControl = taskPane.ContentControl]]></description>
			<content:encoded><![CDATA[<div>Hi<br />
<br />
I am using NetOffice and Visual Studio 2010 Express to develop word COM addins.<br />
<br />
Very simple I want to show a custom task pane (CTP) when a check box is ticked in the ribbon UI.<br />
<br />
NetOffice cannot directly using the standard custom task pane objects that are available in the visual studio express. It has to rely on CTPFactoryAvailable method to show the CTP.<br />
<br />
The following example shows the CTP upon loading up word however I cannot make it more dynamic to only show the CTP when the checkbox is ticked.<br />
<br />
Does anyone have any ideas?<br />
<br />
Adding the ICustomTaskPaneConsumer to the Implements <br />
Office.ICustomTaskPaneConsumer <br />
<br />
And use the CTPFactoryAvailable sub to create the custom task pane. <br />
<br />
Public Sub CTPFactoryAvailable(ByVal CTPFactoryInst As Object) Implements NetOffice.OfficeApi.ICustomTaskPaneConsumer.CTPFactoryAvailable<br />
        Dim ctpFactory As Office.ICTPFactory = New Office.ICTPFactory(_wordApplication, CTPFactoryInst)<br />
        Dim taskPane As Office._CustomTaskPane = ctpFactory.CreateCTP(GetType(Addin).Assembly.GetName().Name + &quot;.SampleControl&quot;, &quot;NetOffice Sample Pane(VB4)&quot;, Type.Missing)<br />
        taskPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionLeft<br />
        taskPane.Width = 300<br />
        taskPane.Visible = True<br />
        _sampleControl = taskPane.ContentControl</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>tfitzhardinge</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721437-Using-CTPFactory-and-CTPFactoryAvailable-methods-to-interact-with-the-ribbon-UI</guid>
		</item>
		<item>
			<title><![CDATA[MsOf10 [RESOLVED] Compare rows and copy to new sheet (VBA)]]></title>
			<link>http://www.vbforums.com/showthread.php?721361-RESOLVED-Compare-rows-and-copy-to-new-sheet-(VBA)&amp;goto=newpost</link>
			<pubDate>Sun, 12 May 2013 12:43:15 GMT</pubDate>
			<description><![CDATA[Hi, me again :P

If Value in Column A > then Column B then copy the row to a new sheet (for example sheet2). Any chance someone knows how to code it in VBA or willing to give me a kickstart?
The sheet isn't always the same and contains 100's or rows, that's why I want to automate it. Had enough of it :P


Thanks in advance.]]></description>
			<content:encoded><![CDATA[<div>Hi, me again :P<br />
<br />
If Value in Column A &gt; then Column B then copy the row to a new sheet (for example sheet2). Any chance someone knows how to code it in VBA or willing to give me a kickstart?<br />
The sheet isn't always the same and contains 100's or rows, that's why I want to automate it. Had enough of it :P<br />
<br />
<br />
Thanks in advance.</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>Radjesh Klauke</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721361-RESOLVED-Compare-rows-and-copy-to-new-sheet-(VBA)</guid>
		</item>
		<item>
			<title><![CDATA[MsOf10 [RESOLVED] Set minimum value Column A (VBA)]]></title>
			<link>http://www.vbforums.com/showthread.php?721355-RESOLVED-Set-minimum-value-Column-A-(VBA)&amp;goto=newpost</link>
			<pubDate>Sun, 12 May 2013 07:22:07 GMT</pubDate>
			<description><![CDATA[Hi,

I have a lot of values in column A. A lot of them are below a value of 10, they all should have a minimum of 10. Anyone with a quick VBA solution?

I tried:


Code:
---------
Sub test()
    Dim c As Range
    Application.ScreenUpdating = False
    For Each c In ActiveSheet.UsedRange.Columns("A")
        If Trim(c.Value) > 0 And c.Value < 10 Then
            c.Value = 10
        End If
    Next c
    Application.ScreenUpdating = True
End Sub
---------
It should skip empty cells if possible.

Thanks in advance.]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I have a lot of values in column A. A lot of them are below a value of 10, they all should have a minimum of 10. Anyone with a quick VBA solution?<br />
<br />
I tried:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Sub test()<br />
&nbsp; &nbsp; Dim c As Range<br />
&nbsp; &nbsp; Application.ScreenUpdating = False<br />
&nbsp; &nbsp; For Each c In ActiveSheet.UsedRange.Columns(&quot;A&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; If Trim(c.Value) &gt; 0 And c.Value &lt; 10 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c.Value = 10<br />
&nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; Next c<br />
&nbsp; &nbsp; Application.ScreenUpdating = True<br />
End Sub</code><hr />
</div>It should skip empty cells if possible.<br />
<br />
Thanks in advance.</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>Radjesh Klauke</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721355-RESOLVED-Set-minimum-value-Column-A-(VBA)</guid>
		</item>
		<item>
			<title>MsOf10 Updating an Excel doc that is already opened from another already opened Excel doc</title>
			<link>http://www.vbforums.com/showthread.php?721229-Updating-an-Excel-doc-that-is-already-opened-from-another-already-opened-Excel-doc&amp;goto=newpost</link>
			<pubDate>Sat, 11 May 2013 00:31:11 GMT</pubDate>
			<description><![CDATA[Hello,  

If I have two to four excel documents  already opened and I want to send updates to one of the other excel documents from one I am working in.

How can I get a list of excel documents that are already opened, and select one to get the handle of it so I can send information to it?   I am looking for code that is dynamic enough that I don't have to hardcode a file name in it and I can use it to select one of the already opened documents that I may not know the location of in my system.

I hope this is clear enough for someone to help.

Thanks in advance,
Genghis]]></description>
			<content:encoded><![CDATA[<div>Hello,  <br />
<br />
If I have two to four excel documents  already opened and I want to send updates to one of the other excel documents from one I am working in.<br />
<br />
How can I get a list of excel documents that are already opened, and select one to get the handle of it so I can send information to it?   I am looking for code that is dynamic enough that I don't have to hardcode a file name in it and I can use it to select one of the already opened documents that I may not know the location of in my system.<br />
<br />
I hope this is clear enough for someone to help.<br />
<br />
Thanks in advance,<br />
Genghis</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>Genghis</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721229-Updating-an-Excel-doc-that-is-already-opened-from-another-already-opened-Excel-doc</guid>
		</item>
		<item>
			<title>SaveAs Macro Enabled Workbook Excel 2010</title>
			<link>http://www.vbforums.com/showthread.php?721167-SaveAs-Macro-Enabled-Workbook-Excel-2010&amp;goto=newpost</link>
			<pubDate>Fri, 10 May 2013 13:05:53 GMT</pubDate>
			<description><![CDATA[We've been using the same macro for years on the older Office versions. Now we have Office 2010 and the macro still works except for saving the workbooks. I've attached screen shots of the errors. Here is a quick breakdown of what the macro does:

1. Opens a template file (which already has macros inside it).
2. Opens some other excel files and manuiplates and transfers the data to the template file.
3. Saves the template file as a new workbook with a unique name.

The problem with the new Office 2010 is that I cannot figure out how to write the code to save as a macro enabled file?? Here is the code snipit where I am trying to save the file and where I get the errors. The error comes after the "MasterWb.SaveAs...." line.

Any help would be greatly appreciated!!



Code:
---------
Workbooks.Open(Filename:="H:\Maintenance\Schedule Template\Rochelle Weekly Schedule Individual Master.xltm").RunAutoMacros Which:=xlAutoOpen
DO ALL THE DATA MANIPULATION STUFF
fileSavePath = DiscWB.Path & "\"
fileSaveName = "Contract " & Format(Now + 3, "mm-dd-yyyy") & ".xlsm"
MasterWb.SaveAs Filename:=fileSavePath & fileSaveName
---------
Attachment 99925 (http://www.vbforums.com/attachment.php?attachmentid=99925)Attachment 99927 (http://www.vbforums.com/attachment.php?attachmentid=99927)]]></description>
			<content:encoded><![CDATA[<div>We've been using the same macro for years on the older Office versions. Now we have Office 2010 and the macro still works except for saving the workbooks. I've attached screen shots of the errors. Here is a quick breakdown of what the macro does:<br />
<br />
1. Opens a template file (which already has macros inside it).<br />
2. Opens some other excel files and manuiplates and transfers the data to the template file.<br />
3. Saves the template file as a new workbook with a unique name.<br />
<br />
The problem with the new Office 2010 is that I cannot figure out how to write the code to save as a macro enabled file?? Here is the code snipit where I am trying to save the file and where I get the errors. The error comes after the &quot;MasterWb.SaveAs....&quot; line.<br />
<br />
Any help would be greatly appreciated!!<br />
<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Workbooks.Open(Filename:=&quot;H:\Maintenance\Schedule Template\Rochelle Weekly Schedule Individual Master.xltm&quot;).RunAutoMacros Which:=xlAutoOpen<br />
DO ALL THE DATA MANIPULATION STUFF<br />
fileSavePath = DiscWB.Path &amp; &quot;\&quot;<br />
fileSaveName = &quot;Contract &quot; &amp; Format(Now + 3, &quot;mm-dd-yyyy&quot;) &amp; &quot;.xlsm&quot;<br />
MasterWb.SaveAs Filename:=fileSavePath &amp; fileSaveName</code><hr />
</div><img src="http://www.vbforums.com/attachment.php?attachmentid=99925&amp;d=1368189921" border="0" alt="Name:  Macro Free Workbook.png
Views: 29
Size:  48.7 KB"  /><img src="http://www.vbforums.com/attachment.php?attachmentid=99927&amp;d=1368189922" border="0" alt="Name:  XLM Sheet.png
Views: 20
Size:  27.2 KB"  /></div>


	<div style="padding:10px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
				<div style="padding:10px">
				<img class="attach" src="http://www.vbforums.com/attachment.php?attachmentid=99925&amp;stc=1&amp;d=1368189921" alt="" />&nbsp;<img class="attach" src="http://www.vbforums.com/attachment.php?attachmentid=99927&amp;stc=1&amp;d=1368189922" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>Esham</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721167-SaveAs-Macro-Enabled-Workbook-Excel-2010</guid>
		</item>
		<item>
			<title>Return the column position of found value within a range</title>
			<link>http://www.vbforums.com/showthread.php?721131-Return-the-column-position-of-found-value-within-a-range&amp;goto=newpost</link>
			<pubDate>Fri, 10 May 2013 08:13:27 GMT</pubDate>
			<description><![CDATA[Hi
I have a named range that sits in range D1 to H1. My program uses the FIND method to check that a value exists in the named range. When the value exists then I want to return the position *within the range* but the following is giving me the position on the worksheet. 


Code:
---------
                DiscountColumn = Sheet4.range("ExportHeadings").Find(What:=DiscountString, MatchCase:=False).Column
---------
So if the value is found in the first position within the named range then I expect the 1 to be returned and not the value 4.

I know I could loop through the range to find the value as it's a small range but I read that the FIND method is much more efficient. 

Is it possible to return the position from within the named range?

Thanks]]></description>
			<content:encoded><![CDATA[<div>Hi<br />
I have a named range that sits in range D1 to H1. My program uses the FIND method to check that a value exists in the named range. When the value exists then I want to return the position <b>within the range</b> but the following is giving me the position on the worksheet. <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DiscountColumn = Sheet4.range(&quot;ExportHeadings&quot;).Find(What:=DiscountString, MatchCase:=False).Column</code><hr />
</div>So if the value is found in the first position within the named range then I expect the 1 to be returned and not the value 4.<br />
<br />
I know I could loop through the range to find the value as it's a small range but I read that the FIND method is much more efficient. <br />
<br />
Is it possible to return the position from within the named range?<br />
<br />
Thanks</div>

]]></content:encoded>
			<category domain="http://www.vbforums.com/forumdisplay.php?37-Office-Development">Office Development</category>
			<dc:creator>scoobster</dc:creator>
			<guid isPermaLink="true">http://www.vbforums.com/showthread.php?721131-Return-the-column-position-of-found-value-within-a-range</guid>
		</item>
	</channel>
</rss>
