#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default Macro Help

I am very new to Macro's but am hoping you can simplify your response

I have a sheet that contains certain data types in specific columns

For example

Column A = Date
B= Name
C=Description
D=Cheque#
E= Account # (Debits)
F = Debit amount
G = Account # (Credits)
H= Credit Amount


I need to write a Marco that will look at this source sheet row by row and
transfer the information to a different sheet with predefined columns

Results Sheet

Column D = Account# (from Columns E and G above)
Column E = Amount (from columns F and H above (Note: Debits are positive,
but Credits need to be converted to a negative number)
Column J = Concantenate Column B and C from source sheet
Column K = Cheque #

Hoping you can help

--
ce
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Macro Help

Try

Sub CopyRowstoDiffSheet()

Dim ws1 As Worksheet, ws2 As Worksheet
Dim lngRow As Long, lngTRow As Long

Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")

For lngRow = 1 To ws1.Cells(Rows.Count, "A").End(xlUp).Row
lngTRow = ws2.Cells(Rows.Count, "A").End(xlUp).Row + 1
ws2.Range("D" & lngTRow) = ws1.Range("E" & lngRow) & _
ws1.Range("G" & lngRow)
ws2.Range("E" & lngTRow) = ws1.Range("F" & lngRow) - _
ws1.Range("H" & lngRow)
ws2.Range("J" & lngTRow) = ws1.Range("B" & lngRow) & " " & _
ws1.Range("C" & lngRow)
ws2.Range("K" & lngTRow) = ws1.Range("D" & lngRow)
Next

End Sub

--
Jacob


"Curtis" wrote:

I am very new to Macro's but am hoping you can simplify your response

I have a sheet that contains certain data types in specific columns

For example

Column A = Date
B= Name
C=Description
D=Cheque#
E= Account # (Debits)
F = Debit amount
G = Account # (Credits)
H= Credit Amount


I need to write a Marco that will look at this source sheet row by row and
transfer the information to a different sheet with predefined columns

Results Sheet

Column D = Account# (from Columns E and G above)
Column E = Amount (from columns F and H above (Note: Debits are positive,
but Credits need to be converted to a negative number)
Column J = Concantenate Column B and C from source sheet
Column K = Cheque #

Hoping you can help

--
ce

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 recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM


All times are GMT +1. The time now is 06:08 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"