Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Code to select cells with data


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...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Code to select cells with data


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
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
Code to select cells with data lostandcondfused Excel Programming 0 January 6th 09 10:19 PM
Select Merged Cells and Unmerge Spread Merge Data To All Cells rtwiss via OfficeKB.com Excel Programming 2 October 2nd 08 04:24 AM
Select data from cells Luis Excel Discussion (Misc queries) 5 June 15th 06 10:21 PM
VBA code to select data from table into combobox Gerry Bennett Excel Programming 1 May 27th 05 03:57 PM
how can i select all the cells with same color on a sheet if there are multipale colors by vba code uobt Charts and Charting in Excel 1 December 15th 04 05:27 PM


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