Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Macro - issue with positioning results

With the help of the online Microsoft team they have provided me with the
following Macro which is transferring data from Sheet 1 to Sheet 3. All I
need to do is display this data from Cell A8 onwards. At present the Macro is
copying everything onto sheet 3 from cell A1 onwards, which is not allowing
me to put any column titles in place. Can you help?

Sub Risks()
Dim lngRow As Long, ws As Worksheet, lngNRow As Long
Set ws = Sheets("Sheet3")
For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Range("A" & lngRow) 0 And Range("A" & lngRow) <= 10 Then
lngNRow = lngNRow + 1: Rows(lngRow).Copy ws.Rows(lngNRow)
End If
Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Macro - issue with positioning results

one change do it i think

For lngRow = 8 To Cells(Rows.Count, "A").End(xlUp).Row

"The Message" wrote in message
...
| With the help of the online Microsoft team they have provided me with the
| following Macro which is transferring data from Sheet 1 to Sheet 3. All I
| need to do is display this data from Cell A8 onwards. At present the Macro
is
| copying everything onto sheet 3 from cell A1 onwards, which is not
allowing
| me to put any column titles in place. Can you help?
|
| Sub Risks()
| Dim lngRow As Long, ws As Worksheet, lngNRow As Long
| Set ws = Sheets("Sheet3")
| For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row
| If Range("A" & lngRow) 0 And Range("A" & lngRow) <= 10 Then
| lngNRow = lngNRow + 1: Rows(lngRow).Copy ws.Rows(lngNRow)
| End If
| Next

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Macro - issue with positioning results

Thanks for that Homey, but I'm afriad that change simply puts rows 8,9 and 10
into Rows 1,2,&3 on sheet 3

"Homey" wrote:

one change do it i think

For lngRow = 8 To Cells(Rows.Count, "A").End(xlUp).Row

"The Message" wrote in message
...
| With the help of the online Microsoft team they have provided me with the
| following Macro which is transferring data from Sheet 1 to Sheet 3. All I
| need to do is display this data from Cell A8 onwards. At present the Macro
is
| copying everything onto sheet 3 from cell A1 onwards, which is not
allowing
| me to put any column titles in place. Can you help?
|
| Sub Risks()
| Dim lngRow As Long, ws As Worksheet, lngNRow As Long
| Set ws = Sheets("Sheet3")
| For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row
| If Range("A" & lngRow) 0 And Range("A" & lngRow) <= 10 Then
| lngNRow = lngNRow + 1: Rows(lngRow).Copy ws.Rows(lngNRow)
| End If
| Next

.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro - issue with positioning results

lngNRow = lngNRow + 1: Rows(lngRow).Copy ws.Rows(lngNRow + 7)

Will put rows 1:10 from Sheet1 into rows 8:17 in Sheet3


Gord Dibben MS Excel MVP


On Mon, 7 Dec 2009 06:12:01 -0800, The Message
wrote:

Thanks for that Homey, but I'm afriad that change simply puts rows 8,9 and 10
into Rows 1,2,&3 on sheet 3

"Homey" wrote:

one change do it i think

For lngRow = 8 To Cells(Rows.Count, "A").End(xlUp).Row

"The Message" wrote in message
...
| With the help of the online Microsoft team they have provided me with the
| following Macro which is transferring data from Sheet 1 to Sheet 3. All I
| need to do is display this data from Cell A8 onwards. At present the Macro
is
| copying everything onto sheet 3 from cell A1 onwards, which is not
allowing
| me to put any column titles in place. Can you help?
|
| Sub Risks()
| Dim lngRow As Long, ws As Worksheet, lngNRow As Long
| Set ws = Sheets("Sheet3")
| For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row
| If Range("A" & lngRow) 0 And Range("A" & lngRow) <= 10 Then
| lngNRow = lngNRow + 1: Rows(lngRow).Copy ws.Rows(lngNRow)
| End If
| Next

.


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
Vlookup with Match - no results issue JICDB Excel Worksheet Functions 2 May 1st 09 02:13 PM
Macro issue 2 Farhad Excel Discussion (Misc queries) 6 December 21st 08 07:14 PM
Macro issue Farhad Excel Discussion (Misc queries) 5 December 21st 08 06:05 PM
Macro issue Sue Excel Discussion (Misc queries) 0 October 8th 08 08:05 PM
Macro Issue basanth New Users to Excel 3 September 10th 08 06:05 PM


All times are GMT +1. The time now is 05:44 PM.

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"