<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; Выбор последней строки в Excel]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=7702</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7702&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Выбор последней строки в Excel».]]></description>
		<lastBuildDate>Mon, 15 Oct 2012 12:07:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Выбор последней строки в Excel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=64777#p64777</link>
			<description><![CDATA[<p>Забыл отписаться) </p><p>Все очень просто:<br /></p><div class="codebox"><pre><code>
LastRow=xlSheet.Cells(1,1).SpecialCells(11).row
		xlSheet.Cells(LastRow+1,1).select
		xlSheet.Paste</code></pre></div><p>Спасибо за помощь!!!!!!!</p>]]></description>
			<author><![CDATA[null@example.com (lyfffi)]]></author>
			<pubDate>Mon, 15 Oct 2012 12:07:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=64777#p64777</guid>
		</item>
		<item>
			<title><![CDATA[Re: Выбор последней строки в Excel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=64776#p64776</link>
			<description><![CDATA[<p>xlSheet.Cells.Item(1,1).SpecialCells(11).Address</p><p>но, но останется - сделайте оформление ячейке ниже нижней и получите её адрес, а не последней заполненной, для последней истинно заполненной нужно пользоваться </p><p>MsgBox xlSheet.Cells.Item(Application.WorksheetFunction.Min(xlSheet.Cells.SpecialCells(11).Row + 1, xlSheet.Cells.Rows.Count), 1).End(-4162).Row</p><p>хотя в большинстве достаточно будет спешелкелс</p>]]></description>
			<author><![CDATA[null@example.com (smaharbA)]]></author>
			<pubDate>Mon, 15 Oct 2012 12:03:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=64776#p64776</guid>
		</item>
		<item>
			<title><![CDATA[Re: Выбор последней строки в Excel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=64772#p64772</link>
			<description><![CDATA[<p>Уже понял что за но. SpecialCells(11) выполняет роль сочетания клавиш Ctrl+End и переходит в конец таблицы, а не в ячейку &quot;A&quot; &amp;</p>]]></description>
			<author><![CDATA[null@example.com (lyfffi)]]></author>
			<pubDate>Mon, 15 Oct 2012 11:27:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=64772#p64772</guid>
		</item>
		<item>
			<title><![CDATA[Re: Выбор последней строки в Excel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=64771#p64771</link>
			<description><![CDATA[<p>xlSheet.Cells.SpecialCells(11).Address</p><p>но есть но.</p>]]></description>
			<author><![CDATA[null@example.com (smaharbA)]]></author>
			<pubDate>Mon, 15 Oct 2012 11:15:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=64771#p64771</guid>
		</item>
		<item>
			<title><![CDATA[Выбор последней строки в Excel]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=64769#p64769</link>
			<description><![CDATA[<p>Добрый день!</p><p>Необходимо находить последнюю ячейку в столбце (А1). На данный момент рабочий вариант есть (поиск пустой ячейки), но хотелось бы узнать о существовании более быстрого варианта, потому что при наличии &gt; 5000 строк, скрипт выполняется очень долго.</p><p>Мой код:<br /></p><div class="codebox"><pre><code>
&#039;********** Создаем объект Excel ****************************************************
  		Set xlApp = CreateObject(&quot;Excel.Application&quot;)
		
		&#039;********** Устанавливаем видимость объекта *****************************************
		xlApp.Visible = true
		
		&#039;*********** Назначаем переменные для открытия книги, листа, объекта ****************
		Set xlWB = xlApp.Workbooks.Open(FileName)
		Set xlSheet = xlWB.Worksheets(1)
		Set obj = ActiveDocument.GetSheetObject(ChartName) 
		
		&#039;*********** Активируем лист ********************************************************
		xlSheet.Activate
	
		&#039;*********** Ищем последнюю заполненую ячейку и переходим на пустую *****************
		
		While Not (Isempty(xlSheet.Cells(iRow, 1))) &#039;******************Хотелось бы избавиться от этогу куска кода!!!!!!!.
			iRow = iRow+1
		Wend
		
		&#039;*********** Обращаемся к таблице из приложения и копируем её в буфер ***************
		
		Set txt1 = ActiveDocument.GetSheetObject(&quot;CH27&quot;)
		txt1.CopyTableToClipboard true
		
		&#039;*********** Выбираем пустую ячейку и вставляем из буфера таблицу *******************
		iRow=1
		xlSheet.Cells(iRow,1).EndRow.Select&#039;xlSheet.Cells(iRow,1).Select
		xlSheet.Paste</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (lyfffi)]]></author>
			<pubDate>Mon, 15 Oct 2012 11:11:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=64769#p64769</guid>
		</item>
	</channel>
</rss>
