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: 13
Default Macro to put data below data in a and b from columns c and d

Need Help! Have my macro putting first row of column C data in column A, but
need the rest of the column to go in as well. Also need to put the data from
column D into column B ( C and D are a set that is of the same data type as a
nd b respectively)
Here is what I have so far.... fairly new to vba, but learning fast.
Thanks!!!
Sub Find_Blank()
Dim BCell, NBCell

Range("A1").Select
Range("B1").Select
For i = 1 To 65536
If ActiveCell.Value = Empty Then 'First empty cell found; put in col
c's stuff:
BCell = "A" & CStr(i)
Range("A" & CStr(i)).Select
CCell = "B" & CStr(i)
Range("B" & CStr(i)).Select
For Each C In Worksheets("Sheet1").Range("C1:C100").Cells
If C.Value < "" Then
Range("A" & CStr(i)).Select
Range("A" & CStr(i)).Value = C.Value
Range("B" & CStr(i)).Select
Range("B" & CStr(i)).Value = D.Value
i = i + 1
Else 'Blank cell in col B found; get column stuff:
'**
For Each D In Worksheets("Sheet1").Range("D1:D100").Cells
If D.Value < "" Then
Range("A" & CStr(i)).Select
Range("A" & CStr(i)).Value = D.Value
i = i + 1
End If
Next D
Exit Sub
'**
End If
Next C
Exit Sub
Else
Range("A" & CStr(i + 1)).Select
End If
Next i
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 to compare few columns data of two spreadsheet kay Excel Programming 1 July 24th 08 11:00 PM
Creating a Macro for refreshing data in a columns [email protected] Excel Programming 3 August 21st 06 02:06 PM
Macro to compare two columns of data Odawg Excel Discussion (Misc queries) 1 October 12th 05 02:51 PM
Macro to compare two columns of data Odawg Excel Discussion (Misc queries) 0 October 12th 05 03:13 AM
Macro to add data to the bottom of columns Rick Excel Discussion (Misc queries) 1 October 3rd 05 05:53 PM


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