Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Help with run-time error

Hi, having some trouble here! Trying to search column B for some text and
then paste (values only) into the cell immediately below. Using the
following but clearly not working and my head is about to explode if I
continue to fumble for an answer. It's the last line that's causing me a
problem. Can anyone help please?

Thanks / Nick

ThisWorkbook.Sheets("Status Report").Select
Set rng = SH.Columns("B:B").Find(What:="Risk Description", _
After:=Range("B58"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

rng.Offset(1).PasteSpecial 'paste description column to status report
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Help with run-time error

(A) It hasn't copied any data

(B) why would you want to copy data? Why not use rng.Offset(1).Value =
rng.Value


(C) it hasn't said paste special what which I think MIGHT be required
Paste:=xlPasteValues

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Help with run-time error

A) Copy happens in previous line
B) ?
C) ?

getting more and more confused......


Range("F15:F" & LastYesRisk).Select
Selection.Copy
ThisWorkbook.Sheets("Status Report").Select
Set rng = SH.Columns("B:B").Find(What:="Risk Description", _
After:=Range("B58"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

rng.Offset(1).PasteSpecial 'paste description column to status report

" wrote:

(A) It hasn't copied any data

(B) why would you want to copy data? Why not use rng.Offset(1).Value =
rng.Value


(C) it hasn't said paste special what which I think MIGHT be required
Paste:=xlPasteValues


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Help with run-time error

OK, happy that the copy happens in the previous line the copy that you
are doing is F15:Fsomething.

My suggestion on B is to do away with the copy and paste

I'm ASSUMING (though I haven't run it) that the rng is returning a
single cell value - but I'm not sure you only want one co-ordinate, as
offset(1) would be one row down, not one column across.

C - again, haven't run the code, but I'm expecting that the line should
read
rng.offset(1).pastespecial :=xlPasteValues


would it help to mail me a file )

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Help with run-time error

on it's way!

" wrote:

OK, happy that the copy happens in the previous line the copy that you
are doing is F15:Fsomething.

My suggestion on B is to do away with the copy and paste

I'm ASSUMING (though I haven't run it) that the rng is returning a
single cell value - but I'm not sure you only want one co-ordinate, as
offset(1) would be one row down, not one column across.

C - again, haven't run the code, but I'm expecting that the line should
read
rng.offset(1).pastespecial :=xlPasteValues


would it help to mail me a file )




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Help with run-time error

Reply has gone back by email, trying to keep the methods you are using
the same, but for the benefit of the group my GUESS is that you haven'
t tested for a failure to find the data, and therefore are using a
NOTHING range to do things to - which excel isn't happy with - putting
in the error test that you have used elsewhere will probably get round
this.

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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
Run-time error '11' & Run-time error '1004' Piers Clinton-Tarestad Excel Programming 0 January 9th 04 07:45 PM


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