Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy data in column based on cell value


Hello Tom,

Thank you very much for your help. I shall try to answer you
questions as best I can. The word "Total" appears as a result of
formula. It will appear in any column in row 4 on the sheet dependin
on the data. The data will change from day to day so the word "Total
will appear in a different column each day but always in row 4. (doe
this make sense?) I then would like to copy just the selected chunck o
rows 6-30 of the column where the word "Total" appears.

I appreciate your help very much. Looking at the piece of code offere
to me, it all makes sense. It is just that initial step that totall
freezes me

--
oakma
-----------------------------------------------------------------------
oakman's Profile: http://www.excelforum.com/member.php...nfo&userid=917
View this thread: http://www.excelforum.com/showthread.php?threadid=27281

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy data in column based on cell value

See if this does what you want.

Sub CopyDateFromTotalColumn()
Dim cell as Range
Dim cell1 as Range
Dim rng as Range
With Worksheets("INCS&DECS")
for each cell in .Rows(4).Cells
if instr(1,cell.Value,"Total",vbTextCompare) then
set cell1 = cell
exit for
end if
Next
set rng = Intersect(cell1.EntireColumn, .rows("6:30"))
End With
rng.copy Destination:=Worksheets("Input").Range("B9")
End With

You didn't say where on sheet INPUT to place the data, so replace the B9
with the top most cell where you want it copied to.

if you want to just paste values you can do
rng.copy
Worksheets("Input").Range("B9").PasteSpecial xlValues

--
Regards,
Tom Ogilvy





"oakman" wrote in message
...

Hello Tom,

Thank you very much for your help. I shall try to answer your
questions as best I can. The word "Total" appears as a result of a
formula. It will appear in any column in row 4 on the sheet depending
on the data. The data will change from day to day so the word "Total"
will appear in a different column each day but always in row 4. (does
this make sense?) I then would like to copy just the selected chunck of
rows 6-30 of the column where the word "Total" appears.

I appreciate your help very much. Looking at the piece of code offered
to me, it all makes sense. It is just that initial step that totally
freezes me.


--
oakman
------------------------------------------------------------------------
oakman's Profile:

http://www.excelforum.com/member.php...fo&userid=9172
View this thread: http://www.excelforum.com/showthread...hreadid=272818



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
Copy last cell with data in column E on one sheet to cell on anoth Seahawk Excel Worksheet Functions 7 May 7th 09 02:52 AM
Copy data from other worksheet based on column header [email protected] Excel Discussion (Misc queries) 0 April 29th 08 08:18 PM
lookup column label based on data in cell Aaron Excel Worksheet Functions 1 August 22nd 06 04:13 PM
Copy data in column based on cell value oakman[_11_] Excel Programming 2 October 27th 04 04:00 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:31 PM.

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"