View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Macro Button To Modify A Cell's Contents?

Sorry, I am missing how you know what the target cell will be. What is the
rule?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Virtanis " wrote in message
...

Yeah, I see the problem with the target cells being all over the sheet.
:(

My next thought would have been to modify the macro to know the
location of the actual target cell by pulling that cell location
(Column/Row) from the current sheet.

Well, after an elaborate series of walkarounds, I was able to pin down,
in a cell on my summary page, the variable location of the target cell
that will be the subject of the "-1" adjustments. As I change my data,
this cell constantly updates that location.

So now, what I was trying to figure out is something along these lines
(forgive the novice pseudo-code).

Public Sub Button3_Click()
LocationXY = Cell D3 on the summary sheet2 'which has the real location
of the moving target cell on sheet1
With Sheets("Sheet1").Range("LocationXY")
Value = .Value - 1
End With
End Sub

Geez... I feel like I'm trying to kill a fly with a shotgun. :)



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