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

Bob


I believe this will give you what you are after


Change sheet names to suit
Sheet 1 must have an entry in it eg headers

change wS2 range to suit


Sub dddd()
Dim c As Range
Dim r As Long
Dim wS2 As Worksheet
Dim wS1 As Worksheet

Set wS1 = Sheets("sheet1")
Set wS2 = Sheets("sheet2")

If wS1.FilterMode Then wS1.ShowAllData
If wS2.FilterMode Then wS2.ShowAllData

For Each c In wS2.Range("g1:g100")
If Not IsEmpty(c) Then

' will error here if nothing exists in wS1
r = wS1.Cells.Find(what:="*", _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row + 1

wS1.Cells(r, 1).Value = wS2.Cells(c.Row, 1).Value
wS1.Cells(r, 2).Value = wS2.Cells(c.Row, 3).Value
End If
Next c
End Su

--
Message posted from http://www.ExcelForum.com

 
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 that isn't working Brad Excel Discussion (Misc queries) 2 October 29th 09 08:23 PM
MACRO IS NOT WORKING AS IT SHOULD jeannie v Excel Worksheet Functions 3 June 21st 07 08:19 AM
Don't want to SEE macro working Randall \(again...\) Excel Programming 2 February 23rd 04 03:20 PM
macro not working on 1 PC, ok on others Greg Koppel Excel Programming 0 September 19th 03 09:42 PM
Macro not working ced[_2_] Excel Programming 1 September 18th 03 10:09 PM


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