LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default trouble with macro

I have two workbooks and am trying to copy the currency value (if entered) in
col B, in rows 19 - 57 only from the "Data Input" WS in WB "Daily Balance
Today" and copy those values to the "Pending" WS in the "Pending and Short"
WB into the next availabel cell in col C. This workbook is a running total
so I need to add the information to the bottom of the spreadsheet. If values
are copied, I need to copy the text from Col A and the date in Col D from the
Data Input WS and copy that text to Col B in the Pending WS on the same row
as the currency value. This code is not working for me and I'm not sure what
is wrong. Thanks in advance for your assistance.


Sub copydata()
Dim rng As Range, rng1 As Range, rng2 As Range
Dim rng3 As Range

With Worksheets("Data Input")
Set rng = .Range("B19:57").SpecialCells(xlConstants, xlTextValues)
If Not rng Is Nothing Then
Set rng1 = Intersect(rng.EntireRow, .Columns(1).Resize(, 4))
Set rng2 = Intersect(rng.EntireRow, .Columns(2))
Else
Exit Sub
End If
End With

Dim bk as Workbook
set bk = Workbooks.Open(C:\Pending and Short Log\Pending and Short.xls")
set rng3 = bk.Worksheets("Pending").Cells(Rows.Count, 2).End(xlUp)(2)

rng1.Copy rng3.Offset(0, -1)
rng2.Copy rng3.Offset(0, 2)

End Sub

 
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 trouble jen_writer Excel Discussion (Misc queries) 1 February 14th 07 11:47 PM
MACRO TROUBLE HELP Excel Discussion (Misc queries) 2 June 7th 06 04:09 PM
Excel macro & MS XP OS trouble Gary Excel Programming 0 July 1st 04 03:16 PM
Having trouble with simple macro! Simon Lloyd[_397_] Excel Programming 1 March 2nd 04 06:23 PM
Macro trouble kdp Excel Programming 1 February 25th 04 10:25 PM


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