LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Sheet to sheet code Type Mismatch


I want to go down the list on sheet2 D column and compare to sheet1 A column and if a match copy column A .Offset(0, 1) back to sheet2 column D .Offset(0, 1).

I can't sniff out the type mismatch error I'm getting.

Then I need to do the same thing as this code but do it between two workbooks.

Thanks,
Howard

Option Explicit

Sub S_1ToS_2()
Dim c As Range
Dim c1 As Variant

For Each c In Sheets(Sheet2).Range("D1:D10")
For Each c1 In Sheets(Sheet1).Range("A1:A25")
If c1.Value = c.Value Then
c1.Offset(0, 1).Copy c.Offset(0, 1)
End If
Next
Next

End Sub
 
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
Help to DEBUG this line of code. Type mismatch error Ayo Excel Programming 9 October 20th 09 09:08 PM
Type Mismatch error in VBA code bobby Excel Programming 3 November 10th 05 08:05 AM
[Q] Save As throws type mismatch error in control's code? Jason Weiss Excel Discussion (Misc queries) 1 July 16th 05 04:21 AM
type mismatch in this code Jay Baxter Excel Programming 4 February 26th 04 06:36 PM
Code works 1st time then Type Mismatch when checking for not blank cells Colleyville Alan Excel Programming 3 February 6th 04 05:21 AM


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