View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Copying values between sheets

Dim rng as Range, rng1 as range
Dim res as Variant
Dim rng2 as Range
with worksheets("Sheet2")
set rng = .rows(1).Find("-ind1-")
set rng1 = .rows(1).Find("-TSCRAL-")
if not rng is nothing and not rng1 is nothing then
res = Application.Match(1,rng.EntireColumn,0)
if not iserror(res) then
set rng2 = rng1(res)
else
msgbox "Today's date not entered"
exit sub
end if
else
msgbox "column not found"
exit sub
end if
End With
worksheets("Sheet1").copy Destination:=rng2

--
Regards,
Tom Ogilvy

"bbuzz" wrote in
message ...

I have an excel file with several sheets. I want to copy values on
sheet 1 using a macro command because I have several values to copy
each day. One value of interest is located on sheet 1 at range b11.

On sheet 2 I have 2 columns, one column called -ind1- returns a '1'
when todays date is entered. The other column called -TSCRAL- is where
I want the value from Sheet 1 pasted (at the intersect of the returned
value 1 of 'ind1' column depending on the date)


--
bbuzz
------------------------------------------------------------------------
bbuzz's Profile:

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