Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2015, 12:19 PM
bryans88 bryans88 is offline Trying to find a macro that will copy a cell and paste that value to a specific sheet Windows 7 32bit Trying to find a macro that will copy a cell and paste that value to a specific sheet Office 2007
Novice
Trying to find a macro that will copy a cell and paste that value to a specific sheet
 
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

Hello,

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
sht.PrintOut
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
  #2  
Old 12-23-2015, 01:40 PM
NoSparks NoSparks is offline Trying to find a macro that will copy a cell and paste that value to a specific sheet Windows 7 64bit Trying to find a macro that will copy a cell and paste that value to a specific sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

If I follow your description, try putting
Code:
sht.range("I80").value=Sheet1.Range(whatever).value
right ahead of
Code:
sht.PrintOut
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy checkbox string and paste it in excel sheet MOHAMMEDSALMAN Excel Programming 7 10-29-2015 03:50 AM
Excel copy two numbers between specific column and paste in next sheet visha_1984 Excel 1 12-26-2014 07:59 PM
Want to change Macro to copy and paste data to new sheet Vortex69 Excel Programming 0 12-23-2014 09:53 PM
Trying to find a macro that will copy a cell and paste that value to a specific sheet Find specific rows then copy and paste to new doc konopca Word VBA 5 02-20-2014 02:34 PM
copy cell from sheet 2 to sheet 3 macro slipperyjim Excel Programming 1 02-18-2010 01:31 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft