Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Range without Blank values

Hello:
i would appreciate help with the following
I have a range (A1:A10) on Sheet1, with names of people. Some of the
cells in this range are blank.
On Sheet2, I want to populate the column A (from A1 downward) with the
list of names from Sheet1, range (A1:A10) but without any blank cells.

Thus for example if on Sheet1, in range A1 to A10 if only cells, A3, A8
& A10 have names & other cells in range A1:A10 are blank, then on
Sheet2, I would like cells A1, A2, A3 to have the values of A3, A8 &
A10 from sheet1

TIA

Vinay

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Range without Blank values

assuming the names have been entered a constants and are not the product of
formulas

Sub CopyData()
Dim rng as Range

On Error Resume Next
With Worksheets("Sheet1")
set rng = .Range("A1:A10").SpecialCells(xlConstants,xlTextVa lues)
End with
On Error goto 0
if not rng is nothing then
With Worksheets("Sheet2")
rng.copy .Range("A1")
End With
end if
End Sub

--
Regards,
Tom Ogilvy



wrote in message
ps.com...
Hello:
i would appreciate help with the following
I have a range (A1:A10) on Sheet1, with names of people. Some of the
cells in this range are blank.
On Sheet2, I want to populate the column A (from A1 downward) with the
list of names from Sheet1, range (A1:A10) but without any blank cells.

Thus for example if on Sheet1, in range A1 to A10 if only cells, A3, A8
& A10 have names & other cells in range A1:A10 are blank, then on
Sheet2, I would like cells A1, A2, A3 to have the values of A3, A8 &
A10 from sheet1

TIA

Vinay



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
Combine and display values in range in 1 cell but skip blank cells Swiss Excel Worksheet Functions 3 September 4th 09 10:00 PM
Need blank if no values in range getting value at the mo' Mifty Excel Worksheet Functions 9 August 29th 08 09:34 AM
Count Non-Blank Values in a Table but only for a range GCRDelphi Excel Worksheet Functions 3 July 12th 08 11:54 AM
Sum of unique values within a range with blank cells loook Excel Worksheet Functions 3 May 12th 08 03:11 PM
Creating a new worksheet by checking for blank values in a range Geoff[_13_] Excel Programming 4 April 6th 06 10:31 PM


All times are GMT +1. The time now is 06:39 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"