•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 427,222 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,253 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 465 | Replies: 2
![]() |
•
•
Join Date: Jul 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I need to copy the data from the top row of a worksheet to all those empty rows underneath it UNTILL you get to a row that has data…then start over and copy that new data into the empty rows….and so on…
I have the code that we've written so far attached and below is an example of the data (a row with info...then blank rows that need to be filled with the above info...)
I'm not so good at this, but if anyone has any suggestions, please let me know
THanks
Jen
16296 INV BALLESTER CONSULTI 4541 29-Jun-07
13518 INV BEST RESEARCH 4271 23-Apr-07
13963 INV BLAUW RESEARCH 4298 30-Apr-07
14250 INV BLAUW RESEARCH 4298 15-May-07
10889 INV BRAINJUICER BV 2270 25-Jan-07
I have the code that we've written so far attached and below is an example of the data (a row with info...then blank rows that need to be filled with the above info...)
I'm not so good at this, but if anyone has any suggestions, please let me know
THanks
Jen
16296 INV BALLESTER CONSULTI 4541 29-Jun-07
13518 INV BEST RESEARCH 4271 23-Apr-07
13963 INV BLAUW RESEARCH 4298 30-Apr-07
14250 INV BLAUW RESEARCH 4298 15-May-07
10889 INV BRAINJUICER BV 2270 25-Jan-07
hi,
Try below coding:
Have a nice Day
Shailaja
Try below coding:
Sub fill2() ' ' fill2 Macro ' ' Declare the Variables Dim intRng As Integer 'Get the Range of rows from the user Dim strStart As String 'Assign the Starting Range Dim strEnd As String 'Assign the Ending Range Dim intI As Integer 'For Loop Dim strRange As String 'Concatenate the strStart and strEnd Dim strVal As String 'Get the Value of the cell 'Get the input from the use for no. of rows intRng = InputBox("Enter the No. of Rows?", "Fill the Blank") For Loop For i = 1 To intRng strStart = "A" & i Starting Range strEnd = "F" & i Ending Range strRange = strStart & ":" & strEnd Concatenation of strStart and strEnd strVal = Cells(i, 1) 'Value of the Cell If strVal <> "" Then ' If the cell contain the values Range(strRange).Select 'Select the Row Selection.Copy 'Copy the row Else 'The below process will be done until the cell is blank Range(strRange).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End If Next End Sub
Have a nice Day
Shailaja
•
•
•
•
I need to copy the data from the top row of a worksheet to all those empty rows underneath it UNTILL you get to a row that has data…then start over and copy that new data into the empty rows….and so on…
I have the code that we've written so far attached and below is an example of the data (a row with info...then blank rows that need to be filled with the above info...)
I'm not so good at this, but if anyone has any suggestions, please let me know
THanks
Jen
16296 INV BALLESTER CONSULTI 4541 29-Jun-07
13518 INV BEST RESEARCH 4271 23-Apr-07
13963 INV BLAUW RESEARCH 4298 30-Apr-07
14250 INV BLAUW RESEARCH 4298 15-May-07
10889 INV BRAINJUICER BV 2270 25-Jan-07
Last edited by Tekmaven : Jul 18th, 2008 at 5:36 am. Reason: Code tags
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Accessing excel worksheet in a word document (VB macro). (Visual Basic 4 / 5 / 6)
- Excel Macro Save as with date in file name (Visual Basic 4 / 5 / 6)
- Excel Macro VBA Help (Visual Basic 4 / 5 / 6)
- Excel Macro Help Needed (Windows Software)
- Excel Macro using vba :( (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: MS access 2003 Combobox problem
- Next Thread: Help with a macro


Linear Mode