Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Help with Range Macro

Hi, anyone help with this macro when run if there is a number greater
than 0 in sheet1 V2 and a number greater than 0 in sheet1 AA2. This
macro copys and pastes twice instead of once. So I get the same rows
twice with the same data. I need somehow to check if there is a number
greater than 0 in both these cells and if so only copy once.

Thanks

Sub ATRANSPOSE_Click()
Dim R As Range
Dim p As Range
Dim Q As Range
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")

'Infring
Application.ScreenUpdating = False
Set R = ws.Range("V2", ws.Range("V37").End(xlUp))
For Each V In R.Cells
If Application.WorksheetFunction.IsNumber(V.Value) Then
If V.Value 0 Then
V.Offset(0, -2).Range("A1:h1").Copy
Worksheets("1a").Range("E19").End(xlUp).Offset(1,
0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

End If
End If
Next V

'Orders
Set R = ws.Range("AA2", ws.Range("AA37").End(xlUp))
For Each AA In R.Cells
If Application.WorksheetFunction.IsNumber(AA.Value) Then
If AA.Value 0 Then
AA.Offset(0, -7).Range("A1:h1").Copy
Worksheets("1a").Range("E19").End(xlUp).Offset(1,
0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

End If
End If
Next AA
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Help with Range Macro

DISREGARD SOLVED

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
macro to select range from active cell range name string aelbob Excel Programming 2 July 14th 08 09:19 PM
Macro deletes row in range, macro then skips the row moved up steven.holloway Excel Discussion (Misc queries) 8 June 11th 08 11:40 AM
Macro to copy a specified range to a variable range SWT Excel Programming 4 October 21st 05 08:24 PM
Macro won't execute when "For Each 'range' in 'range'" is added Bill Dika Excel Programming 1 July 12th 04 07:33 PM
Macro to input formula in range based on another range Peter Atherton Excel Programming 0 October 9th 03 12:47 AM


All times are GMT +1. The time now is 01:04 AM.

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

About Us

"It's about Microsoft Excel"