Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
famdamly
 
Posts: n/a
Default Please correct my macro


My understanding of vb is not very good.


If ActiveCell.Column = t Then ActiveCell.Offset(0, -1).Text = "25"
else ActiveCell.Offset(0, 1).Text = "25"


I have a button between two columns in the center of the screen. I want
the user the to select a cell from one of the two columns, then select
from one of the buttons in between the columns that will assign a value
to the cell on the outside of each column.


--
famdamly
------------------------------------------------------------------------
famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382
View this thread: http://www.excelforum.com/showthread...hreadid=519085

  #2   Report Post  
Posted to microsoft.public.excel.misc
Arvi Laanemets
 
Posts: n/a
Default Please correct my macro

Hi


If ActiveCell.Column = t Then
ActiveCell.Offset(0, -1).Text = "25"
Else
ActiveCell.Offset(0, 1).Text = "25"
End If

, or
ActiveCell.Offset(0, Iif(ActiveCell.Column = t,-1,1)).Text ="25"


Arvi Laanemets


"famdamly" wrote in
message ...

My understanding of vb is not very good.


If ActiveCell.Column = t Then ActiveCell.Offset(0, -1).Text = "25"
else ActiveCell.Offset(0, 1).Text = "25"


I have a button between two columns in the center of the screen. I want
the user the to select a cell from one of the two columns, then select
from one of the buttons in between the columns that will assign a value
to the cell on the outside of each column.


--
famdamly
------------------------------------------------------------------------
famdamly's Profile:

http://www.excelforum.com/member.php...o&userid=29382
View this thread: http://www.excelforum.com/showthread...hreadid=519085



  #3   Report Post  
Posted to microsoft.public.excel.misc
famdamly
 
Posts: n/a
Default Please correct my macro


Thanks, I tried each of those and each brings back a run time error 424
object required.


--
famdamly
------------------------------------------------------------------------
famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382
View this thread: http://www.excelforum.com/showthread...hreadid=519085

  #4   Report Post  
Posted to microsoft.public.excel.misc
Arvi Laanemets
 
Posts: n/a
Default Please correct my macro

Hi

The 't' in your formula is a column label, not a variable? Then

If ActiveCell.Column = 20 Then
ActiveCell.Offset(0, -1).Text = "25"
Else
ActiveCell.Offset(0, 1).Text = "25"
End If

, or
ActiveCell.Offset(0, Iif(ActiveCell.Column = 20,-1,1)).Text ="25"


Arvi Laanemets


"famdamly" wrote in
message ...

Thanks, I tried each of those and each brings back a run time error 424
object required.


--
famdamly
------------------------------------------------------------------------
famdamly's Profile:

http://www.excelforum.com/member.php...o&userid=29382
View this thread: http://www.excelforum.com/showthread...hreadid=519085



  #5   Report Post  
Posted to microsoft.public.excel.misc
famdamly
 
Posts: n/a
Default Please correct my macro


I kind of thought that might have something to do with it.

Thank you very much for your help.


--
famdamly
------------------------------------------------------------------------
famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382
View this thread: http://www.excelforum.com/showthread...hreadid=519085



  #6   Report Post  
Posted to microsoft.public.excel.misc
famdamly
 
Posts: n/a
Default Please correct my macro


Darn, it is still not working, same error, and I did have a cell
selected.


--
famdamly
------------------------------------------------------------------------
famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382
View this thread: http://www.excelforum.com/showthread...hreadid=519085

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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Macro help - copy a cell down gjcase Excel Discussion (Misc queries) 3 September 4th 05 05:09 AM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Issuing macro in workbook from separate workbook Nigel Excel Discussion (Misc queries) 1 May 16th 05 05:46 PM


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