Search : in
By :

Get macro to copy cells (not targeted)

craigo, on Mar 1, 2009 8:04:51 pm GMT 
 Report this message to moderators

Hello,
In a macro I'm trying to move the active cell over to the right one cell and copy that and the further 10 cells to the right. I've managed to move the activated cell with the offset command but can't get it to copy all the cells?

Sub Macro1()
'
' Macro1 Macro
'

'
ActiveSheet.Unprotect
ActiveCell.Offset(0, 1).Select
Selection.Copy
Range("B2").Select
ActiveSheet.Paste
Rows("2:2").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Rows("3:3").Select
Selection.Copy
Rows("2:2").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Reply to craigo

Configuration: Windows Vista
Internet Explorer 7.0

Best answers for « get macro to copy cells (not targeted) » in :
Cell input to call macro in adjacent cell ShowCell input to call macro in adjacent cell Issue Solution Note Issue I have a scenario that i'd like automated. The scenario is as follows If i enter a value in any cell in a particular column, i want the system time to be entered...
[VBA] Detecting changes in cell Show[VBA] Detecting changes in cell The Event Change feature of a sheet will detects the change in the active cell but it gives no information about the content. The example given below will help you to find out if the cell was changed,...
NTLDR - Boot.ini - NTDETECT Missing (no Windows cd) ShowNTLDR - Boot.ini - NTDETECT Missing (no Windows cd) If you have the installation CD of Windows, see this tip. If you do not have it, then follow the procedure below: You have a message warning you that one of these files is missing: NTLDR...
Worksheet - Cells ShowThe Concept of a Cell A "cell" is the intersection between a line (horizontal) and a column (vertical) on a worksheet. Thus, the name of the line combined with the name of the column gives the cell's coordinates (the term address is sometimes also...