Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Fill with a formula until Cell is Blank

What code would I use to copy a formula down until Column A.. is blank. I
can copy etc but don't know what code to use that identifies that Column A
is blank


Thanks



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill with a formula until Cell is Blank

Range("C1").Copy
x = 2
Do Until Cells(x, 1).Value = ""
Cells(x, 3).PasteSpecial xlPasteFormulas
x = x + 1
Loop

- Piku

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Fill with a formula until Cell is Blank

I'm still having a problem, it hits debug on my second line i..e
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,3,0)*$E2"




Sub Format_Query()


Sheets("Sales Mix").Select


Range("F2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,3,0)*$E2"
Range("G2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,4,0)*$E2"
Range("H2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,5,0)*$E2"
Range("I2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,6,0)*$E2"
Range("J2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,7,0)*$E2"


Range("F2.J2").Copy
x = 2
Do Until Cells(x, 1).Value = ""
Cells(x, 3).PasteSpecial xlPasteFormulas
x = x + 1
Loop


Range("A1").Select

End Sub


"pikus " wrote in message
...
Range("C1").Copy
x = 2
Do Until Cells(x, 1).Value = ""
Cells(x, 3).PasteSpecial xlPasteFormulas
x = x + 1
Loop

- Pikus


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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Fill with a formula until Cell is Blank

use ActiveCell.Formula =
instead of
ActiveCell.FormulaR1C1 =

"John" wrote in message
...
I'm still having a problem, it hits debug on my second line i..e
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,3,0)*$E2"




Sub Format_Query()


Sheets("Sales Mix").Select


Range("F2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,3,0)*$E2"
Range("G2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,4,0)*$E2"
Range("H2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,5,0)*$E2"
Range("I2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,6,0)*$E2"
Range("J2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,7,0)*$E2"


Range("F2.J2").Copy
x = 2
Do Until Cells(x, 1).Value = ""
Cells(x, 3).PasteSpecial xlPasteFormulas
x = x + 1
Loop


Range("A1").Select

End Sub


"pikus " wrote in message
...
Range("C1").Copy
x = 2
Do Until Cells(x, 1).Value = ""
Cells(x, 3).PasteSpecial xlPasteFormulas
x = x + 1
Loop

- Pikus


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





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Fill with a formula until Cell is Blank

Thanks for the reply, I just recorded the macro and used that recorded code


"Cecilkumara Fernando" <cekufdo@sltnetDOTlk wrote in message
...
use ActiveCell.Formula =
instead of
ActiveCell.FormulaR1C1 =

"John" wrote in message
...
I'm still having a problem, it hits debug on my second line i..e
ActiveCell.FormulaR1C1 = "=VLOOKUP($C2,Master_Menu_Item_Nos,3,0)*$E2"




Sub Format_Query()


Sheets("Sales Mix").Select


Range("F2").Select
ActiveCell.FormulaR1C1 =

"=VLOOKUP($C2,Master_Menu_Item_Nos,3,0)*$E2"
Range("G2").Select
ActiveCell.FormulaR1C1 =

"=VLOOKUP($C2,Master_Menu_Item_Nos,4,0)*$E2"
Range("H2").Select
ActiveCell.FormulaR1C1 =

"=VLOOKUP($C2,Master_Menu_Item_Nos,5,0)*$E2"
Range("I2").Select
ActiveCell.FormulaR1C1 =

"=VLOOKUP($C2,Master_Menu_Item_Nos,6,0)*$E2"
Range("J2").Select
ActiveCell.FormulaR1C1 =

"=VLOOKUP($C2,Master_Menu_Item_Nos,7,0)*$E2"


Range("F2.J2").Copy
x = 2
Do Until Cells(x, 1).Value = ""
Cells(x, 3).PasteSpecial xlPasteFormulas
x = x + 1
Loop


Range("A1").Select

End Sub


"pikus " wrote in message
...
Range("C1").Copy
x = 2
Do Until Cells(x, 1).Value = ""
Cells(x, 3).PasteSpecial xlPasteFormulas
x = x + 1
Loop

- Pikus


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







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
Fill a blank cell with a value using if conditions rjagathe New Users to Excel 7 December 20th 09 12:22 PM
Fill blank cells with an if formula? Gaby Excel Worksheet Functions 1 September 17th 07 04:26 PM
Automatically fill blank cell by same as just above record [email protected] Excel Discussion (Misc queries) 2 March 3rd 07 05:24 PM
Fill column blanks from last non-blank cell C. BROWN Excel Discussion (Misc queries) 2 August 28th 06 08:36 PM
Fill cell that is blank Slashman Excel Worksheet Functions 7 August 28th 06 01:30 AM


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