<link rel="stylesheet" type="text/css" href="http://excelvbamacro.com/wp-content/plugins/wp-secure-by-sitesecuritymonitorcom/css/hiddenloginerror.css" /> <script type="text/javascript">document.getElementById('wp-version-message').innerHTML = '';</script> <?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" > <channel><title>Comments on: Getting Cell Reference With Input Box</title> <atom:link href="http://excelvbamacro.com/getting-cell-references-with-input-box/feed/" rel="self" type="application/rss+xml" /><link>http://excelvbamacro.com/getting-cell-references-with-input-box/</link> <description>Excel VBA Macro Tutorial and Examples</description> <lastBuildDate>Tue, 25 May 2010 20:23:08 +0800</lastBuildDate> <generator>http://wordpress.org/?v=404</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: Viviana Maphis</title><link>http://excelvbamacro.com/getting-cell-references-with-input-box/comment-page-1/#comment-325</link> <dc:creator>Viviana Maphis</dc:creator> <pubDate>Sun, 21 Jun 2009 07:23:15 +0000</pubDate> <guid isPermaLink="false">http://excelvbamacro.com/?p=13#comment-325</guid> <description>This macro has been very useful, how ever, I cant paste outside the workbook, how can I add a line to prompt for a file or just move to another file and paste?Thank you</description> <content:encoded><![CDATA[<p>This macro has been very useful, how ever, I cant paste outside the workbook, how can I add a line to prompt for a file or just move to another file and paste?</p><p>Thank you</p> ]]></content:encoded> </item> <item><title>By: Excel VBA Macro</title><link>http://excelvbamacro.com/getting-cell-references-with-input-box/comment-page-1/#comment-310</link> <dc:creator>Excel VBA Macro</dc:creator> <pubDate>Sun, 14 Jun 2009 15:17:25 +0000</pubDate> <guid isPermaLink="false">http://excelvbamacro.com/?p=13#comment-310</guid> <description>hi pankaj, if you use my vba code above, then it&#039;s already set to paste all, both values and formats.</description> <content:encoded><![CDATA[<p>hi pankaj, if you use my vba code above, then it&#8217;s already set to paste all, both values and formats.</p> ]]></content:encoded> </item> <item><title>By: pankaj</title><link>http://excelvbamacro.com/getting-cell-references-with-input-box/comment-page-1/#comment-305</link> <dc:creator>pankaj</dc:creator> <pubDate>Tue, 09 Jun 2009 18:47:02 +0000</pubDate> <guid isPermaLink="false">http://excelvbamacro.com/?p=13#comment-305</guid> <description>how do I change it to paste values and formats?</description> <content:encoded><![CDATA[<p>how do I change it to paste values and formats?</p> ]]></content:encoded> </item> <item><title>By: James Quinn</title><link>http://excelvbamacro.com/getting-cell-references-with-input-box/comment-page-1/#comment-16</link> <dc:creator>James Quinn</dc:creator> <pubDate>Fri, 07 Nov 2008 01:59:45 +0000</pubDate> <guid isPermaLink="false">http://excelvbamacro.com/?p=13#comment-16</guid> <description>Well done. I needed a way to grab user range. This showed me how. Preesh.</description> <content:encoded><![CDATA[<p>Well done. I needed a way to grab user range. This showed me how. Preesh.</p> ]]></content:encoded> </item> <item><title>By: admin</title><link>http://excelvbamacro.com/getting-cell-references-with-input-box/comment-page-1/#comment-13</link> <dc:creator>admin</dc:creator> <pubDate>Sat, 25 Oct 2008 05:40:15 +0000</pubDate> <guid isPermaLink="false">http://excelvbamacro.com/?p=13#comment-13</guid> <description>yaa you are right jp, if the input range object is nothing, then its will fail, thanks for your revision :)</description> <content:encoded><![CDATA[<p>yaa you are right jp, if the input range object is nothing, then its will fail, thanks for your revision <img src='http://excelvbamacro.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: JP</title><link>http://excelvbamacro.com/getting-cell-references-with-input-box/comment-page-1/#comment-12</link> <dc:creator>JP</dc:creator> <pubDate>Fri, 17 Oct 2008 20:35:55 +0000</pubDate> <guid isPermaLink="false">http://excelvbamacro.com/?p=13#comment-12</guid> <description>The Copy Method accepts a Destination, if you declare InputCells and OutputCells as Range Objects, you can take advantage of the Intellisense. Also, the code will silently fail if no range is selected. Here&#039;s an updated version with declarations and error handling:&lt;pre class=&quot;brush:vb&quot;&gt; Sub CopyPaste()Dim InputCells As Excel.Range Dim OutputCells As Excel.Range On Error Resume Next &#039;Show input box to get range of cells that want to copy Set InputCells = _ Application.InputBox(prompt:=&quot;Block input cells/range&quot;, _ Title:=&quot;Copy Paste&quot;, Type:=8) On Error GoTo 0 If InputCells Is Nothing Then GoTo ExitProc &#039;Show input box to get where they want it paste Set OutputCells = _ Application.InputBox(prompt:=&quot;Select cell where you want paste it&quot;, _ Title:=&quot;Copy Paste&quot;, Type:=8) On Error GoTo 0If OutputCells Is Nothing Then GoTo ExitProc &#039;Copy range of input cells InputCells.Copy OutputCells ExitProc: Set InputCells = Nothing Set OutputCells = Nothing End Sub &lt;/pre&gt;--JP</description> <content:encoded><![CDATA[<p>The Copy Method accepts a Destination, if you declare InputCells and OutputCells as Range Objects, you can take advantage of the Intellisense. Also, the code will silently fail if no range is selected. Here&#8217;s an updated version with declarations and error handling:</p><pre class="brush:vb">
Sub CopyPaste()

Dim InputCells As Excel.Range
Dim OutputCells As Excel.Range

On Error Resume Next
'Show input box to get range of cells that want to copy
Set InputCells = _
Application.InputBox(prompt:="Block input cells/range", _
Title:="Copy Paste", Type:=8)
On Error GoTo 0

If InputCells Is Nothing Then GoTo ExitProc

'Show input box to get where they want it paste
Set OutputCells = _
Application.InputBox(prompt:="Select cell where you want paste it", _
Title:="Copy Paste", Type:=8)
On Error GoTo 0

If OutputCells Is Nothing Then GoTo ExitProc

'Copy range of input cells
InputCells.Copy OutputCells

ExitProc:
Set InputCells = Nothing
Set OutputCells = Nothing
End Sub
</pre><p>&#8211;JP</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 8/21 queries in 0.095 seconds using disk

Served from: excelvbamacro.com @ 2010-07-30 19:55:02 -->