More Excel VBA questions
#1
Ok - I'm getting there honest.
I have a vlookup formula and I want to copy it down throught the spreadsheet. The problem as usual is the spreadsheet has a different number of rows each time.
I can't find away of just selecting the cells that need filling. The F5 special almost works but just copies in the formuala exactly as it appears in the first vlookup and so returns that value throughout. I need to Vlookup formula to select the corresponding cell each time not the same one!!!!
It must be easy????
I have a vlookup formula and I want to copy it down throught the spreadsheet. The problem as usual is the spreadsheet has a different number of rows each time.
I can't find away of just selecting the cells that need filling. The F5 special almost works but just copies in the formuala exactly as it appears in the first vlookup and so returns that value throughout. I need to Vlookup formula to select the corresponding cell each time not the same one!!!!
It must be easy????
#4
Matt,
I normally use a do loop method to create formuale down a sheet.
Example code to calculate column B * C:
Dim iCounter as Integer 'Used to increment for each row
range("a2").select
iCounter = 2 'Match to the first row of the starting point
do
activecell.offset(0,3).formula="=B" & icounter & " * C" & icounter
activecell.offset(1,0).select ' Move to next row
iCounter = iCounter + 1 ' Increment counter
loop until activecell.value = "" 'Loops down column A until a blank cell is found
Range("a1").select
The vlookup can be substituted to the formula.
if you need any more help email me.
Martin.
I normally use a do loop method to create formuale down a sheet.
Example code to calculate column B * C:
Dim iCounter as Integer 'Used to increment for each row
range("a2").select
iCounter = 2 'Match to the first row of the starting point
do
activecell.offset(0,3).formula="=B" & icounter & " * C" & icounter
activecell.offset(1,0).select ' Move to next row
iCounter = iCounter + 1 ' Increment counter
loop until activecell.value = "" 'Loops down column A until a blank cell is found
Range("a1").select
The vlookup can be substituted to the formula.
if you need any more help email me.
Martin.
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
18 November 2015 07:03 AM
Brzoza
Engine Management and ECU Remapping
1
02 October 2015 05:26 PM