#use warnings; #use strict; use Cwd; use OLE; use Win32::OLE::Const "Microsoft Excel"; #-----------------------"Copy From" Destination------------------------- my ( $xl_report ) = ( "c:/perl/energy.xls" ); my ( $excel, $workbook, $sheet, $row, @data,$i, $j,$char,$char2,$printme,$FindMe, @FindMe ); $excel = CreateObject OLE 'Excel.Application'; $excel -> {Visible} = 1; $excel -> {EnableEvents} = "false"; #-----------------------Formating and Setup--------------------------- $workbook = $excel -> Workbooks -> Open ( "$xl_report" ) or &terminate ( "open $xl_report" ); $sheet = $workbook -> Worksheets( "info" ); $sheet -> Activate; #---------------------Search for Text-------------------------------- #print "Find what !?\n"; #$FindMe = ;#I also tried multiple types for ($j=1; $j<27; $j++)#loop to go through Columns { $FindMe= findme; $char= chr($j+64); $char2= chr($j+65); for ($i=1; $i<30; $i++)#loop to go through Rows { if (($sheet -> Range ( $char . $i ) -> {Value}) eq $FindMe) { $data = $sheet -> Range ( $char2 . "$i" ) -> {Value}; } } } $sheet -> Range ( "Z" . 1 ) -> {Value} = $data; print "ENDDATA: $data";