Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Copy and Paste Column Address

Status
Not open for further replies.

HProutt

Programmer
Oct 1, 2008
10
0
0
US
I am trying to take write VB code to help me facilitate a copy and paste. I want to copy information from EITHER Sheet 1: Column G or Column H to Sheet 2: Column B. I can copy it based on a double-click fine, but I want Sheet 2: Column B to know (when it gets copied) where it came from - either Column G or Column H and also copy over the cell coloring associated with the column/cell. I don't know how to write code that says essentially: this information was copied from Column G so bring over the information and colors associated with Column G. How do I identify the cell address? Any thoughts would be appreciated. Thanks.
 



Hi,

I assume this is Excel. Yes?

When you copy and paste a range, it copies the values and formats unless you instruct differently using some PasteSpecial parameter.
Code:
[i]SourceRange[/i].Copy Destination:=[i]DestinationCell[/i]


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top