Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Macro to copy from active cell and down

Hi,

Can someone help with a macro doing this:

From active cell copy down in actual column until no more cells with text is
met.
Blank cells should be ignored.

That means copying should stop at the end of a cell with text no matter how
many blank cells is in between.

Regards,
Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Macro to copy from active cell and down


On 3-Nov-2013, Claus Busch wrote:

Dim LRow As Long

LRow = Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(ActiveCell.Row, 1), Cells(LRow, 1)) _
.SpecialCells(xlCellTypeConstants).Offset(, 1) _
= ActiveCell

--------------------------------------------------------------------------------
Hi Claus,

I don't want to fill. Just send the selection (found by the macro) to the
clipboard.
I have tried to google a solution for this, unfortunately without luck.
Do you have another suggestion?

Regards,
Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Macro to copy from active cell and down

Hi Kaj,

Am Sun, 3 Nov 2013 13:11:34 +0100 schrieb Claus Busch:

.SpecialCells(xlCellTypeConstants, 23).Copy


if you have formulas in the column change the line above to:
SpecialCells(xlCellTypeFormulas, 23).copy


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Macro to copy from active cell and down

Perfect. Exactly what I wanted.
Sometimes it is difficult from the beginning to describe the requirement :-)

Thank you for helping once again.

Regards,
Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Macro to copy from active cell and down

Hi Claus,

It is almost as I wanted.
I also want to copy the blank cells, so I figured this out myself:


Sub Test()
Dim LRow As Long

With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
.Range(.Cells(ActiveCell.Row, 1), .Cells(LRow, 1)).COPY
End With
End Sub


It works provided I select a cell in column A.
If it is for use in column C, I have to first change the macro. (Digits 1 to
digits 3 in the two lines of the macro).

Is it possible to write a macro so that no matter what cell and column is
selected, the previously specified area will be sent to the clipboard?

Regards,
Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run macro although blinking cursor is active in an active cell bartman1980 Excel Programming 1 December 20th 07 11:29 AM
Help: Macro Copy Active Cell to Range Name, loop [email protected] Excel Programming 3 March 30th 07 08:25 PM
copy name from active sheet to cell - using macro or function dymek Excel Worksheet Functions 2 October 2nd 06 12:32 PM
Macro Copy Active Cell to Range Name, loop zigstick Excel Programming 6 April 27th 05 07:55 PM
Macro to copy cell data to word document based on an active row? Brian Excel Programming 2 September 16th 04 01:55 PM


All times are GMT +1. The time now is 05:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"