Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Deletion of cells by next blank cell command??

Hi,

I am using Excel '97.

I have a macro that copies data from an input sheet and pastes it into
another, but it is deleting cells and moving the deleted selection (25 Cells)
to the left on the last paste.

The macro has been written in a setup sheet, which the user then modifies by
input to reflect their needs. The macro works fine in the setup sheet, but
when run in a sequence of macros creating the user defined sheet, it causes
25 cells to be deleted to the left (in the KEY sheet, column E). Please can
anyone tell me why this is happening from the code below?

Sub KEY_CREATE

Dim CELL As Range, RNG As Range
With Worksheets("SETUP")
Set RNG = .Range(.Range("C3:C52"), .Range("C3:C52") .End(xlDown))
End With

For Each CELL in RNG
If CELL < "" Then
iNextFree = Cells(Rows.Count, "E").End(xlUp).Row + 1
Worksheets("SETUP").Range("D" & Cell.Row, "AB" & CELL.Row).Copy
Sheets("KEY").Select
Cells(iNextFree, "E").PasteSpecial Paste:=xlValues,
Operation:=xlNone, _
SkipBlanks:=False, TRANSPOSE:=True
End If
Next
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Deletion of cells by next blank cell command??

I have moved this code nearer to the end of the programme, without adjusting
it in any way, and it now works without deleting any cells. I would still
appreciate any input if this was an obvious solution to an obvious problem?

Thanks.

"ewan7279" wrote:

Hi,

I am using Excel '97.

I have a macro that copies data from an input sheet and pastes it into
another, but it is deleting cells and moving the deleted selection (25 Cells)
to the left on the last paste.

The macro has been written in a setup sheet, which the user then modifies by
input to reflect their needs. The macro works fine in the setup sheet, but
when run in a sequence of macros creating the user defined sheet, it causes
25 cells to be deleted to the left (in the KEY sheet, column E). Please can
anyone tell me why this is happening from the code below?

Sub KEY_CREATE

Dim CELL As Range, RNG As Range
With Worksheets("SETUP")
Set RNG = .Range(.Range("C3:C52"), .Range("C3:C52") .End(xlDown))
End With

For Each CELL in RNG
If CELL < "" Then
iNextFree = Cells(Rows.Count, "E").End(xlUp).Row + 1
Worksheets("SETUP").Range("D" & Cell.Row, "AB" & CELL.Row).Copy
Sheets("KEY").Select
Cells(iNextFree, "E").PasteSpecial Paste:=xlValues,
Operation:=xlNone, _
SkipBlanks:=False, TRANSPOSE:=True
End If
Next
End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stopping IF command from entering zero or 1 for blank cells Nick S Excel Worksheet Functions 3 November 20th 09 05:41 PM
Allowing row deletion in worksheet with locked cells MT Excel Discussion (Misc queries) 2 July 16th 09 04:06 AM
Deletion Of Cells DDD Excel Worksheet Functions 1 December 10th 08 01:19 AM
address command for a range of cells, not one cell Khoshravan Excel Discussion (Misc queries) 1 May 5th 06 01:45 PM
Keyboard Command to go to next blank cell Debra Farnham Excel Discussion (Misc queries) 2 October 4th 05 08:27 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"