Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default like a vlookup

I have a list of name and data which is gapped and need filling in.

column a row 1 has name1 in it this needs copying down into all the empty
cells under it until the next populated cell. this will work until the
bottom row i guess where i dont want it to copy till the end of the sheet. so
i have a number in column J which is also the amount of empty rows till the
next populated cell below, can it run off this.

any help would be awesome.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default like a vlookup

Try this....

Sub InsertDataintoBlank()

lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row

For lngRow = 1 To lngLastRow
If Trim(Range("A" & lngRow)) < "" Then
strData = Range("A" & lngRow)
Else
Range("A" & lngRow) = strData
End If
Next
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"project manager" wrote:

I have a list of name and data which is gapped and need filling in.

column a row 1 has name1 in it this needs copying down into all the empty
cells under it until the next populated cell. this will work until the
bottom row i guess where i dont want it to copy till the end of the sheet. so
i have a number in column J which is also the amount of empty rows till the
next populated cell below, can it run off this.

any help would be awesome.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default like a vlookup

works a charm apart from (Rows.Count, "B").End...

should be "A"

thanks very much

p

"Jacob Skaria" wrote:

Try this....

Sub InsertDataintoBlank()

lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row

For lngRow = 1 To lngLastRow
If Trim(Range("A" & lngRow)) < "" Then
strData = Range("A" & lngRow)
Else
Range("A" & lngRow) = strData
End If
Next
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"project manager" wrote:

I have a list of name and data which is gapped and need filling in.

column a row 1 has name1 in it this needs copying down into all the empty
cells under it until the next populated cell. this will work until the
bottom row i guess where i dont want it to copy till the end of the sheet. so
i have a number in column J which is also the amount of empty rows till the
next populated cell below, can it run off this.

any help would be awesome.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default like a vlookup

Without using a macro you can achieve this..

If A2 is blank, type formula =A1. Copy the cell.

Select Col A. Press F5. From Goto window click Special and then select
Blanks which will select all the blank cells in Col A. Then try Paste special
--Formulas.

If this post helps click Yes
---------------
Jacob Skaria


"project manager" wrote:

I have a list of name and data which is gapped and need filling in.

column a row 1 has name1 in it this needs copying down into all the empty
cells under it until the next populated cell. this will work until the
bottom row i guess where i dont want it to copy till the end of the sheet. so
i have a number in column J which is also the amount of empty rows till the
next populated cell below, can it run off this.

any help would be awesome.

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
If (Vlookup 0) working, but what if Vlookup cell does not exist Steve Excel Worksheet Functions 18 November 18th 09 07:33 PM
VLookUp - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
using a vlookup to enter text into rows beneath the vlookup cell Roger on Excel Excel Programming 1 November 29th 07 12:09 PM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Which is faster: VLOOKUP-worksheet or VB-array VLOOKUP? erikhs[_20_] Excel Programming 1 August 6th 06 06:18 PM


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