#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Range Loop


Hi,

I have an excel spreadsheet that contains data in a number of columns
(some contain data and some do not). I would like to have a seperate
spreadsheet check the range (E3:IV3), if data is present in this row, I
would like the seperate spreadsheet to write the cell values of the
range to a seperate spreadsheet. How can I approach this issue?

Thanks in advance for anyhelp


--
lbargers
------------------------------------------------------------------------
lbargers's Profile: http://www.excelforum.com/member.php...o&userid=32798
View this thread: http://www.excelforum.com/showthread...hreadid=526899

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

Can we conclude that if there is data in Column E, then the row should be
copied

Sub CopyData()
Dim rng as Range, rng1 as Range
Dim rng2 as Range
With Activesheet
set rng = .Range(.cells(3,"E"),.Cells(rows.count,"E").End(xl up))
On error resume next
set rng1 = rng.Specialcells(xlconstants)
On Error goto 0
if not rng1 is nothing then
set rng2 = intersect(rng1.EntireRow, .Columns("E:IV"))
rng2.copy Destination:=Worksheets("Data").Range("A1")
end if
End With
End Sub

--
Regards,
Tom Ogilvy


"lbargers" wrote in
message ...

Hi,

I have an excel spreadsheet that contains data in a number of columns
(some contain data and some do not). I would like to have a seperate
spreadsheet check the range (E3:IV3), if data is present in this row, I
would like the seperate spreadsheet to write the cell values of the
range to a seperate spreadsheet. How can I approach this issue?

Thanks in advance for anyhelp


--
lbargers
------------------------------------------------------------------------
lbargers's Profile:

http://www.excelforum.com/member.php...o&userid=32798
View this thread: http://www.excelforum.com/showthread...hreadid=526899



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Range Loop


Tom, thanks for your reply.. How can I specify the location of th
seperate .xls spreadsheets in the example you provided

--
lbarger
-----------------------------------------------------------------------
lbargers's Profile: http://www.excelforum.com/member.php...fo&userid=3279
View this thread: http://www.excelforum.com/showthread.php?threadid=52689

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
Add a Range to an existing Range in a loop? Mick Excel Programming 3 June 18th 05 06:12 AM
Loop through a range James Excel Programming 1 April 8th 05 07:59 PM
For Each Loop w/ a range xlcharlie Excel Programming 3 April 8th 05 07:43 PM
loop in range Aksel Børve Excel Programming 3 March 9th 05 02:30 PM
Loop through a range Fred[_21_] Excel Programming 6 October 22nd 04 10:45 PM


All times are GMT +1. The time now is 10:42 AM.

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

About Us

"It's about Microsoft Excel"