Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default devide the whole column...

Hi
I'm looking for a simple vba code to devide the whole column with
spesific value?

example
devide column A with 1000 without any temporary cell and exclude th
empty cell in the column.

best regards
Run

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default devide the whole column...

Hi
before we go into VBA you may consider the following
procedu
- enter 1000 in an empty cell and copy this cell
- select your target range
- hit F5, click 'Special' and choose 'Constants'
- goto 'Edit - Paste Special and choose the action 'Divide'

Now the VBA way:
sub divide_all
dim rng as range
dim cell as range
dim divisor

set rng = selection
divisor =1000
for each cell in rng



-----Original Message-----
Hi
I'm looking for a simple vba code to devide the whole

column with a
spesific value?

example
devide column A with 1000 without any temporary cell and

exclude the
empty cell in the column.

best regards
Rune


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

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default devide the whole column...

Hi
sorry the VBA code got interrupted. Try

sub divide_all()
Dim rng as range
Dim cell as range
dim divisor
set rng = selection
divisor = 1000
application.screenupdating=false
for each cell in rng
if isnumeric(cell.value) then
cel.value=cell.value/divisor
end if
next
application.screenupdating=true
end sub

-----Original Message-----
Hi
I'm looking for a simple vba code to devide the whole

column with a
spesific value?

example
devide column A with 1000 without any temporary cell and

exclude the
empty cell in the column.

best regards
Rune


---
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
sum and devide with not null value Are Excel Discussion (Misc queries) 2 February 27th 10 10:34 PM
Charte - how to devide the axes into 2 sones Kathrine Charts and Charting in Excel 2 October 25th 09 04:18 PM
devide by 1000 Atiq Excel Discussion (Misc queries) 5 April 29th 09 08:52 PM
Cell with numbers and names, need to devide them Lion2004 Excel Discussion (Misc queries) 2 December 5th 07 12:46 PM
devide by 0 error Dreamstar_1961 Excel Worksheet Functions 7 May 6th 07 06:44 AM


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