Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Copy Data From Above

Hi, wonder if someone can help please.

I have a great bit of coding below from Norman Jones which deletes contents
of cells and copies and pastes the data from above rows. I've tried to get
hold of him again to see if he could help in tweaking this code perhaps he's
had enough of my questions, don't blame him.

Anyway, rather than the code looking at the whole page I need a specific
range. Norman gave me this amendment 'Set myRange =
Activesheet.Range("A2:A10")', but unfortuantely this selects the range
specifically looking at rows. I basically need the coding to pick the range
columns A to I only, but for it to continue looking down the page copying the
data as in the original coding.

Can someone help please.

Kind regards

Chris

Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).EntireRow.Copy _
Destination:=.Item(1)
End If
End With
Next cl

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copy Data From Above

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row).Resize(,9)

would extend it out to column I.

--
Regards,
Tom Ogilvy


"ir26121973" wrote:

Hi, wonder if someone can help please.

I have a great bit of coding below from Norman Jones which deletes contents
of cells and copies and pastes the data from above rows. I've tried to get
hold of him again to see if he could help in tweaking this code perhaps he's
had enough of my questions, don't blame him.

Anyway, rather than the code looking at the whole page I need a specific
range. Norman gave me this amendment 'Set myRange =
Activesheet.Range("A2:A10")', but unfortuantely this selects the range
specifically looking at rows. I basically need the coding to pick the range
columns A to I only, but for it to continue looking down the page copying the
data as in the original coding.

Can someone help please.

Kind regards

Chris

Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).EntireRow.Copy _
Destination:=.Item(1)
End If
End With
Next cl

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Copy Data From Above

Tom,

Thanks for this.

I've tried the code, but unfortunately it still changes the columns out of
the range A:I. Any ideas please ?

Kind regards

Chris

"Tom Ogilvy" wrote:

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row).Resize(,9)

would extend it out to column I.

--
Regards,
Tom Ogilvy


"ir26121973" wrote:

Hi, wonder if someone can help please.

I have a great bit of coding below from Norman Jones which deletes contents
of cells and copies and pastes the data from above rows. I've tried to get
hold of him again to see if he could help in tweaking this code perhaps he's
had enough of my questions, don't blame him.

Anyway, rather than the code looking at the whole page I need a specific
range. Norman gave me this amendment 'Set myRange =
Activesheet.Range("A2:A10")', but unfortuantely this selects the range
specifically looking at rows. I basically need the coding to pick the range
columns A to I only, but for it to continue looking down the page copying the
data as in the original coding.

Can someone help please.

Kind regards

Chris

Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).EntireRow.Copy _
Destination:=.Item(1)
End If
End With
Next cl

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copy Data From Above

Well, that is true, but you said you wanted it to look at. It was looking
only at column A and I expanded that to I. Now it appears what you want is
for it to continue looking only in column A, but to act only out to column I.
the adjustment would then be


Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).Resize(1,9).Copy _
Destination:=.Item(1)
End If
End With
Next cl

End Sub

--
Regards,
Tom Ogilvy



"ir26121973" wrote:

Tom,

Thanks for this.

I've tried the code, but unfortunately it still changes the columns out of
the range A:I. Any ideas please ?

Kind regards

Chris

"Tom Ogilvy" wrote:

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row).Resize(,9)

would extend it out to column I.

--
Regards,
Tom Ogilvy


"ir26121973" wrote:

Hi, wonder if someone can help please.

I have a great bit of coding below from Norman Jones which deletes contents
of cells and copies and pastes the data from above rows. I've tried to get
hold of him again to see if he could help in tweaking this code perhaps he's
had enough of my questions, don't blame him.

Anyway, rather than the code looking at the whole page I need a specific
range. Norman gave me this amendment 'Set myRange =
Activesheet.Range("A2:A10")', but unfortuantely this selects the range
specifically looking at rows. I basically need the coding to pick the range
columns A to I only, but for it to continue looking down the page copying the
data as in the original coding.

Can someone help please.

Kind regards

Chris

Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).EntireRow.Copy _
Destination:=.Item(1)
End If
End With
Next cl

End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Copy Data From Above

Tom,

Thanks for this.

Please excuse my 'Muppetry', very new to VB, learning as I go along.

Many thanks for your patience.

All the best

Chris

"Tom Ogilvy" wrote:

Well, that is true, but you said you wanted it to look at. It was looking
only at column A and I expanded that to I. Now it appears what you want is
for it to continue looking only in column A, but to act only out to column I.
the adjustment would then be


Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).Resize(1,9).Copy _
Destination:=.Item(1)
End If
End With
Next cl

End Sub

--
Regards,
Tom Ogilvy



"ir26121973" wrote:

Tom,

Thanks for this.

I've tried the code, but unfortunately it still changes the columns out of
the range A:I. Any ideas please ?

Kind regards

Chris

"Tom Ogilvy" wrote:

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row).Resize(,9)

would extend it out to column I.

--
Regards,
Tom Ogilvy


"ir26121973" wrote:

Hi, wonder if someone can help please.

I have a great bit of coding below from Norman Jones which deletes contents
of cells and copies and pastes the data from above rows. I've tried to get
hold of him again to see if he could help in tweaking this code perhaps he's
had enough of my questions, don't blame him.

Anyway, rather than the code looking at the whole page I need a specific
range. Norman gave me this amendment 'Set myRange =
Activesheet.Range("A2:A10")', but unfortuantely this selects the range
specifically looking at rows. I basically need the coding to pick the range
columns A to I only, but for it to continue looking down the page copying the
data as in the original coding.

Can someone help please.

Kind regards

Chris

Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range

Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).EntireRow.Copy _
Destination:=.Item(1)
End If
End With
Next cl

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
filted data, copy and paste a col. puts data in wrong row how fix chris_fig New Users to Excel 1 October 16th 06 04:26 PM
Retrieve multiple data rows data from a very long list and copy t mathew Excel Discussion (Misc queries) 1 September 13th 06 08:24 PM
How do I copy data from main frame computer and keep data in cell Doug Excel Worksheet Functions 1 May 30th 06 05:15 PM
Copy old Data from web query while keeping previous days data DRobidoux Excel Worksheet Functions 0 March 22nd 06 01:56 PM
Copy data into cells until changes trigger new copy mdeanda Excel Programming 2 April 25th 05 01:32 PM


All times are GMT +1. The time now is 10:09 PM.

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"