![]() |
why!?
hi everyon
i´m trying to get this commandbutton (that is in sheets(1)) to work Private Sub botao_m1_Click( Application.ScreenUpdating = Fals Sheets(4).Selec Range("K15").Selec Selection.Cop Range("M15").Selec Selection.PasteSpecial Paste:=xlPasteValue etc.. |
why!?
Rui,
Because the code is in the sheet's code module, you must prefix the Range objects with the sheet name if the range is not in the sheet containing the code. Sheets(4).Select Sheets(4).Range("K15").Select Selection.Copy Sheets(4).Range("M15").Select Selection.PasteSpecial Paste:=xlPasteValues -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Rui" wrote in message ... hi everyone i´m trying to get this commandbutton (that is in sheets(1)) to work: Private Sub botao_m1_Click() Application.ScreenUpdating = False Sheets(4).Select Range("K15").Select Selection.Copy Range("M15").Select Selection.PasteSpecial Paste:=xlPasteValues etc.. |
why!?
I recommend going about this differeently.
Worksheets(4).Cells(15, 13).Value = _ Worksheets(4).Cells(15, 11).Value This will work and be much faster than what you are currently trying to do. - Pikus --- Message posted from http://www.ExcelForum.com/ |
why!?
thanks, Chip.
that's it |
why!?
What do you get?
-- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Rui" wrote in message ... hi everyone i´m trying to get this commandbutton (that is in sheets(1)) to work: Private Sub botao_m1_Click() Application.ScreenUpdating = False Sheets(4).Select Range("K15").Select Selection.Copy Range("M15").Select Selection.PasteSpecial Paste:=xlPasteValues etc.. |
All times are GMT +1. The time now is 04:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com