ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code needed big time! (https://www.excelbanter.com/excel-programming/339755-code-needed-big-time.html)

oberon.black[_42_]

Code needed big time!
 

I need a code that will copy the content of cells A12:E42 on worksheet A
to the cells of B10:F51 on worksheet B.

This code must be added to worksheet B simply becuase worksheet A has a
ton of code on it already.

I would perfer for this to happen automatically but I will be very
happy if this even has to be added as a button on worksheet B.

I am very new at this so please inform me of code and where this code
should be placed

Thank you for your support.


--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=466659


Tom Ogilvy

Code needed big time!
 
Private Sub Worksheet_Activate()
Worksheets("A").Range("A12:E42").Copy _
Destination:=Me.Range("B10")
End Sub

Right click on the sheet tab of Worksheet B and select view code. Put in
code like the above.

--
Regards,
Tom Ogilvy


"oberon.black"
wrote in message
news:oberon.black.1v7qaa_1126472721.1266@excelforu m-nospam.com...

I need a code that will copy the content of cells A12:E42 on worksheet A
to the cells of B10:F51 on worksheet B.

This code must be added to worksheet B simply becuase worksheet A has a
ton of code on it already.

I would perfer for this to happen automatically but I will be very
happy if this even has to be added as a button on worksheet B.

I am very new at this so please inform me of code and where this code
should be placed

Thank you for your support.


--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile:

http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=466659




bill k

Code needed big time!
 

Sheets("Sheet1").Select
Range("A12:E42").Select
Selection.Copy
Sheets("Sheet2").Activate
Range("B10:F40").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("a5").Select



Copy the code and insert it into the "this workbook"
between the lines.............

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)

End Sub

To get there

rightclick onto the excel picture to the left of "File" on the men
bar
select view code
select workbook on the dropdown next to "general"
select before save on the dropdown next to "open"

paste the code between the lines

You can select any other event that may suit you as well as the befor
save.

"before print" is a good one

This code will only work automatically in the this workbook code as
it needs to select different sheets

--
bill

-----------------------------------------------------------------------
bill k's Profile: http://www.excelforum.com/member.php...info&userid=82
View this thread: http://www.excelforum.com/showthread.php?threadid=46665



All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com