ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to check cell data (https://www.excelbanter.com/excel-programming/305328-how-check-cell-data.html)

Jeff Armstrong

How to check cell data
 
I am needing to set up a test condition to test if the
activecell is a string or number. If it's a number I want
it to sum up the cells. If it's a string I want it to
copy and paste. I believe I have the correct code for the
sum and copy/paste. I just don't know what the code is
for the If test.

If activecell = <code to see if cell is some number then
activecell.offset(rowoffset:=1,columnoffset:=0).se lect
activecell.application.worksheetfunction.sum(myRan ge)
else
activecell.copy
activecell.offset(rowoffset:=1,columnoffset:=0).se lect
activecell.pastespecial xlpastevalues
end if

I left out the code that sets myRange using the Range()
function. I just need to know what I can place in the
first line of code to make this work.

Jeff

Mauro Gamberini

How to check cell data
 
I am needing to set up a test condition to test if the
activecell is a string or number.


If IsNumeric(ActiveCell.Value) Then
*****
Else
****
End If

--
----------------------------
Mauro Gamberini




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com