View Single Post
Old 12-23-2015, 12:19 PM
bryans88 bryans88 is offline Windows 7 32bit Office 2007
Join Date: Dec 2015
Posts: 1
bryans88 is on a distinguished road
Default Trying to find a macro that will copy a cell and paste that value to a specific sheet


Let me start by saying I am not an expert in VBA, but I have started to dabble as it makes life so much easier. Here is my predicament. I have one master data input sheet that is used to populate the fields of 23 separate (machine specific) sheets. Each of the machine specific sheets is identified by cell C5. In my master input sheet Cell B1 refers to that same value. So my question is, how can i write a macro that would copy a specific cell from sheet 1 (master input) and paste to a cell in its corresponding sheet. for example:

Copy Sheet1 cell b5
paste into cell I80 of the sheet whos cell C5 = Sheet1's B1

I have a macro for printing the corresponding report based on that rule, but i do not know how to go about applying the same principal to copy and paste.

Here is my print macro:

Sub Test5()
Dim sht As Worksheet

For Each sht In ThisWorkbook.Worksheets
If sht.Range("C5").Value = Sheet1.Range("B1") Then
End If
Next sht

End Sub

As you can see it calls to print the sheet whos C5 value equals that of sheet1's B1 value. I have tried many different things but I am completely stumped. If anyone could shed some light on the subject it would be greatly appreciated.
Reply With Quote