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: 48
Default macro not working as intended

Ok, I have been at this for awhile, with no knowledge of VB at all, what I am
trying to do is copy all the rows on a sheet to the appropriate named sheet
using the B column as the reference to the sheet name. I have the code
working to where i dont get errors now, but its not working as intended. i
dont get any errors.. but its not moving all the data, only some of it, the
names are correct, it just dosn't move them. For example, it skips everything
that goes to the "BOB" sheet, even though there is plenty of things that
match that criteria, but the "RES" sheet has everythign moved over to it just
fine.. its being selective..any help would be great here is the code i have
that produces no errors

Sub CopyToSheets()

Dim rng As Range
Dim oCell As Range

Set rng = Range("B4:B" & Cells(Rows.Count, "B").End(xlUp).Row)
For Each oCell In rng
oCell.EntireRow.Copy _
Destination:=Sheets(oCell.Value).Range("A65536").E nd(xlUp).Offset(1,
0)
Next oCell


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
Conditional Formatting Not Working As Intended Bishop Excel Worksheet Functions 3 February 5th 10 08:51 PM
Excel 2003 worksheet duplication -not intended Joan Excel Worksheet Functions 2 December 17th 07 04:10 PM
Limit Macro to Intended worksheet. Quin Excel Worksheet Functions 2 March 2nd 07 02:49 AM
Macro working in Excel 2003; not working in Excel 2000 Leslie Barberie Excel Programming 5 May 20th 04 07:51 PM
Code deleting values -- not as intended Stuart[_5_] Excel Programming 2 May 3rd 04 07:36 PM


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