PC Review


Reply
Thread Tools Rate Thread

Code to select cells with data

 
 
lostandcondfused
Guest
Posts: n/a
 
      6th Jan 2009

I cant seem to find any help for a code to select cells with data in it and
pasting them on to a different sheet. For example... I need Sheet1 to
autopopulate with data on sheets 2, 3 and 4 by clicking a button. But I only
want it to copy the cells that only have data/text in it and then paste it to
Sheet 1. Does anyone have an idea on how to go about doing this? I need help
really bad...
 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      6th Jan 2009

First define the range you need to copy:
Set sSheet = Worksheets("Sheet1")
Set Scell = Range("A1:A5")
Then Destination:
Set dSheet = Worksheets("Sheet2")
Set Dcell = dSheet.Range("A2")
Then copy paste:
sCell.Copy
DCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=false
Application.CutCopyMode = False
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"lostandcondfused" wrote:

> I cant seem to find any help for a code to select cells with data in it and
> pasting them on to a different sheet. For example... I need Sheet1 to
> autopopulate with data on sheets 2, 3 and 4 by clicking a button. But I only
> want it to copy the cells that only have data/text in it and then paste it to
> Sheet 1. Does anyone have an idea on how to go about doing this? I need help
> really bad...

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Code to select cells with data lostandcondfused Microsoft Excel Programming 0 6th Jan 2009 10:19 PM
RE: Select Merged Cells and Unmerge Spread Merge Data To All Cells RyanH Microsoft Excel Programming 0 2nd Oct 2008 03:38 AM
Select All Cells Containing Data =?Utf-8?B?YWp2YXNlbA==?= Microsoft Excel Programming 7 19th Jul 2006 07:03 PM
MS Word: select cells range and duplicate same data in all cells =?Utf-8?B?Y2xhcmljZQ==?= Microsoft Word Document Management 0 1st Jun 2006 04:19 AM
how can i select all the cells with same color on a sheet if there are multipale colors by vba code uobt Microsoft Excel Charting 1 15th Dec 2004 05:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:23 AM.