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: 557
Default Macro help needed

I am trying to make below macro work but there is something not
correct. I am getting error on line

Worksheets("Sheet3").Cells(row3, Range("A" & row3 & ":C" & row3)) =
Worksheets("Sheet1").Cells(row1, Range("B" & row1 & ":D" & row1))

Please can any body can help

Sub CheckInfo()
Dim row1, row2, row3 As Integer
row3 = 2 ' Sheet3
row2 = 2 ' Sheet2
While Worksheets("Sheet2").Cells(row2, 1) < ""
row1 = 2 ' Sheet1
While Worksheets("Sheet1").Cells(row1, 1) < ""
If Worksheets("Sheet1").Cells(row1, 1) = Worksheets("Sheet2").Cells
(row2, 1) Then
Worksheets("Sheet3").Cells(row3, Range("A" & row3 & ":C" & row3)) =
Worksheets("Sheet1").Cells(row1, Range("B" & row1 & ":D" & row1))
row3 = row3 + 1
End If
row1 = row1 + 1
Wend
row2 = row2 + 1
Wend
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
macro help needed Carolina Girl[_2_] Excel Worksheet Functions 1 March 24th 09 04:50 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to set macro security in Excel to minimum Carl Excel Programming 3 March 18th 06 03:36 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 07:27 PM.

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"