Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
TheDPQ
 
Posts: n/a
Default Insert New Rows based on COUNTA()


This might not be the right area however i am a newbie to Excel so i
figure i'd start here. I have very limited experience with Excel so
excuse me if i don't make sense.
ANY HELP IN THE RIGHT DIRECTION WOULD BE AWESOME


I have a Column full of keywords, and i have a column full of Ad IDs...
is there a way in a *new* sheet to insert the keywords in as many times
as there are ads?

SHEET 1
Keyword 1 | 123
Keyword 2 | 456
xxxxxxxxx | 789

SHEET 2
Keyword 1 | 123
Keyword 1 | 456
Keyword 1 | 789
Keyword 2 | 123
Keyword 2 | 456
Keyword 2 | 789


I found COUNTA() Which lets me count how many keywords and ads i have,
i'm just not sure what to do with those numbers now.


--
TheDPQ
------------------------------------------------------------------------
TheDPQ's Profile: http://www.excelforum.com/member.php...o&userid=30915
View this thread: http://www.excelforum.com/showthread...hreadid=505922

  #2   Report Post  
Posted to microsoft.public.excel.newusers
Anne Troy
 
Posts: n/a
Default Insert New Rows based on COUNTA()

If I've got you right, perhaps this will help?
http://www.officearticles.com/excel/...soft_excel.htm
************
Hope it helps!
Anne Troy
www.OfficeArticles.com

"TheDPQ" wrote in
message ...

This might not be the right area however i am a newbie to Excel so i
figure i'd start here. I have very limited experience with Excel so
excuse me if i don't make sense.
ANY HELP IN THE RIGHT DIRECTION WOULD BE AWESOME


I have a Column full of keywords, and i have a column full of Ad IDs...
is there a way in a *new* sheet to insert the keywords in as many times
as there are ads?

SHEET 1
Keyword 1 | 123
Keyword 2 | 456
xxxxxxxxx | 789

SHEET 2
Keyword 1 | 123
Keyword 1 | 456
Keyword 1 | 789
Keyword 2 | 123
Keyword 2 | 456
Keyword 2 | 789


I found COUNTA() Which lets me count how many keywords and ads i have,
i'm just not sure what to do with those numbers now.


--
TheDPQ
------------------------------------------------------------------------
TheDPQ's Profile:
http://www.excelforum.com/member.php...o&userid=30915
View this thread: http://www.excelforum.com/showthread...hreadid=505922



  #3   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default Insert New Rows based on COUNTA()

You could use a macro:

Option Explicit
Sub testme()
Dim myCol1 As Range
Dim myCol2 As Range
Dim myCell1 As Range
Dim myCell2 As Range
Dim wks As Worksheet
Dim newWks As Worksheet
Dim oRow As Long

Set wks = Worksheets("Sheet1")

With wks
Set myCol1 = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
Set myCol2 = .Range("b1", .Cells(.Rows.Count, "B").End(xlUp))
If myCol1.Cells.Count * myCol2.Cells.Count .Rows.Count Then
MsgBox "Too much data!"
Exit Sub
End If
End With

Set newWks = Worksheets.Add

oRow = 0
For Each myCell1 In myCol1.Cells
For Each myCell2 In myCol2.Cells
oRow = oRow + 1
With newWks.Cells(oRow, "A")
.Value = myCell1.Value
.Offset(0, 1).Value = myCell2.Value
End With
Next myCell2
Next myCell1

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

TheDPQ wrote:

This might not be the right area however i am a newbie to Excel so i
figure i'd start here. I have very limited experience with Excel so
excuse me if i don't make sense.
ANY HELP IN THE RIGHT DIRECTION WOULD BE AWESOME

I have a Column full of keywords, and i have a column full of Ad IDs...
is there a way in a *new* sheet to insert the keywords in as many times
as there are ads?

SHEET 1
Keyword 1 | 123
Keyword 2 | 456
xxxxxxxxx | 789

SHEET 2
Keyword 1 | 123
Keyword 1 | 456
Keyword 1 | 789
Keyword 2 | 123
Keyword 2 | 456
Keyword 2 | 789

I found COUNTA() Which lets me count how many keywords and ads i have,
i'm just not sure what to do with those numbers now.

--
TheDPQ
------------------------------------------------------------------------
TheDPQ's Profile: http://www.excelforum.com/member.php...o&userid=30915
View this thread: http://www.excelforum.com/showthread...hreadid=505922


--

Dave Peterson
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
Insert rows based on specific value bob Excel Worksheet Functions 6 February 29th 08 08:11 PM
List rows in an order based on a cells value Josh M Excel Discussion (Misc queries) 0 September 14th 05 04:51 PM
How to quickly insert a blank row every 5 rows? Med Excel Discussion (Misc queries) 2 September 10th 05 12:32 AM
Simultaneouly insert of rows or col. - Ajit Ajit Munj Excel Discussion (Misc queries) 1 March 23rd 05 10:17 AM
INSERT ROWS WITHOUT SCREWING-UP FORMULAS! BILL GATES - I WANNA WORD WITH YOU! Excel Worksheet Functions 1 March 4th 05 02:32 PM


All times are GMT +1. The time now is 02:48 PM.

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"