Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Finding last cell in column containing formulas using VBA

I have a table which is updated, then the values from three columns
transferred over to another sheet, folllowing on from the last time data was
transferred (the table gets wiped each time this is done.. The first two
columns are ok to find the last cell, as they are text, and are copied like
this:

Range("A2", Range("B65536").End(xlUp)).Name = "draughtsmenproject"
Range("draughtsmenproject").Copy
Sheets("Tally").Select
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste

The final column though, contains a SUM formula, which counts as a 'filled'
cell when excel checks. Can i get Excel to ignore the formula if the result
is 0, or would i be better using an offset function in VBA, to count across
the number of columns from one of the last two text entries to the last SUM
entry (which would be on the same line).

Any help is appreciated.

Richard
--
Richard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Finding last cell in column containing formulas using VBA

You could either go across two columns from the last cell in column A by
adding .Offset(0,2), or go up 1 row from the C column with .Offset(-1,0)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Richard" wrote in message
...
I have a table which is updated, then the values from three columns
transferred over to another sheet, folllowing on from the last time data

was
transferred (the table gets wiped each time this is done.. The first two
columns are ok to find the last cell, as they are text, and are copied

like
this:

Range("A2", Range("B65536").End(xlUp)).Name = "draughtsmenproject"
Range("draughtsmenproject").Copy
Sheets("Tally").Select
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste

The final column though, contains a SUM formula, which counts as a

'filled'
cell when excel checks. Can i get Excel to ignore the formula if the

result
is 0, or would i be better using an offset function in VBA, to count

across
the number of columns from one of the last two text entries to the last

SUM
entry (which would be on the same line).

Any help is appreciated.

Richard
--
Richard




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Finding last cell in column containing formulas using VBA

Thanks Bob

I have tried to insert the offset onto the range i defined as
"draughtsmenproject", so it would go two across from there. The problem is
that the null values in the cells that contained the formulas are being taken
across to the other sheet. i was hoping to be able to use the offset function
for the column C values only when there was a value in column A and column B.

--
Richard


"Bob Phillips" wrote:

You could either go across two columns from the last cell in column A by
adding .Offset(0,2), or go up 1 row from the C column with .Offset(-1,0)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Richard" wrote in message
...
I have a table which is updated, then the values from three columns
transferred over to another sheet, folllowing on from the last time data

was
transferred (the table gets wiped each time this is done.. The first two
columns are ok to find the last cell, as they are text, and are copied

like
this:

Range("A2", Range("B65536").End(xlUp)).Name = "draughtsmenproject"
Range("draughtsmenproject").Copy
Sheets("Tally").Select
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste

The final column though, contains a SUM formula, which counts as a

'filled'
cell when excel checks. Can i get Excel to ignore the formula if the

result
is 0, or would i be better using an offset function in VBA, to count

across
the number of columns from one of the last two text entries to the last

SUM
entry (which would be on the same line).

Any help is appreciated.

Richard
--
Richard





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Finding last cell in column containing formulas using VBA

Do you mean a range that ignores rows that have no value? I thought you were
just referring to the last row, where A & B were null, C had a formula.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Richard" wrote in message
...
Thanks Bob

I have tried to insert the offset onto the range i defined as
"draughtsmenproject", so it would go two across from there. The problem is
that the null values in the cells that contained the formulas are being

taken
across to the other sheet. i was hoping to be able to use the offset

function
for the column C values only when there was a value in column A and column

B.
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
Finding First Empty Cell in a Column TomHull Excel Discussion (Misc queries) 5 November 9th 09 01:19 AM
Finding the last non bank cell in a column Andrew B[_4_] Excel Programming 3 June 18th 05 10:12 AM
Finding Cell Interior Colour of First Cell in Column ExcelMonkey[_190_] Excel Programming 4 March 22nd 05 03:01 AM
Finding column of a particular cell Prema Excel Programming 4 February 7th 05 06:44 PM
Finding the last used cell in a column Ben's Oak Excel Programming 5 July 16th 04 04:12 AM


All times are GMT +1. The time now is 12:05 PM.

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"