Copying specific cells

andrewrp1 Posts 1 Registration date Thursday September 20, 2018 Status Member Last seen September 20, 2018 - Updated on Sep 20, 2018 at 05:24 PM
 Blocked Profile - Sep 20, 2018 at 05:12 PM

I am trying to use a command button to copy information from specific cells in sheet 1 to a excel form I made in sheet 2. The cells are not the same from sheet 1 to sheet 2. Is there a way to do that with a simple type of command that can be reused in succession for additional cell information that I would need to copy to the form?

Example "G2" on sheet 1 would be copied on "J9" on sheet 2. Then so on....

1 response

You are correct, you hard code the relationship in the placement of the entry.

Thecellvalue = ThisWorkbook.Worksheets(WSA).Range("G2").value
ThisWorkbook.Worksheets(WSB).Range("J9").value = ThecellValue

Or, you could build a multideminsional array like:


and loop through each element in the array, parsing the "to" and "from" cells from the array entries. Now just build a loop from 1 to how ever many numbers of entries there are, and loop it!