Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to copy a range of cells from sheet 1 to sheet 2 every second,
but incrementing the sheet 2 column every loop to create a history trail. The code is working but at run time it pastes only the first copy of the loop for every iteration. So all the pasted columns are exactly the same. In debug the code seems to work OK. One solution may be to clear the clipboard within the loop. Any ideas anyone please. Dim col As Integer For col = 1 To 20 'DO EVERY SECOND newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Sheets("Sheet1").Select Range("D6:d64").Select Selection.Copy Sheets("Sheet2").Select Range("B6").Select ActiveCell.Offset(0, col).Activate Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Next col End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
bar chart not copying correctly into powerpoint | Excel Discussion (Misc queries) | |||
Copying Formulas - correctly stated | Excel Discussion (Misc queries) | |||
Dynamic chart not updating correctly. | Charts and Charting in Excel | |||
Help with copying dynamic column selected based on remote cell value and dynamic formula fill | Charts and Charting in Excel | |||
Help with copying dynamic column selected based on remote cell value and dynamic formula fill | Excel Programming |