Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default fill a cell with this..

hi all i have to fill cell A20 with ]Sheet1'!$B$999
where 999 is the value of cell A20.
if u can describe the right syntax, that will help me a lot !! ty


Sub A22()
Dim aWB As Workbook
Dim aWS As Worksheet
Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

aWS.Range("A22") = ]Sheet1'!$B$" &
aWS.Range("A20").Value
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default fill a cell with this..

You left out an equal sign.

I'd use:


aWS.Range("A22").formula _
= ]Sheet1'!$B$" & aWS.Range("A20").Value

Or maybe...

with aws.range("a22")
.numberformat = "General"
.formula = _
= ]Sheet1'!$B$" & aWS.Range("A20").Value
end with

(just in case A22 was formatted as Text.)

ps. I wouldn't use an address as the name of the macro, either.

pls123 wrote:

hi all i have to fill cell A20 with ]Sheet1'!$B$999
where 999 is the value of cell A20.
if u can describe the right syntax, that will help me a lot !! ty


Sub A22()
Dim aWB As Workbook
Dim aWS As Worksheet
Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

aWS.Range("A22") = ]Sheet1'!$B$" &
aWS.Range("A20").Value
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default fill a cell with this..

try this
aWS.Range("A22") = ]Sheet1'!$B$" &
aWS.Range("A20").Value
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"pls123" wrote:

hi all i have to fill cell A20 with ]Sheet1'!$B$999
where 999 is the value of cell A20.
if u can describe the right syntax, that will help me a lot !! ty


Sub A22()
Dim aWB As Workbook
Dim aWS As Worksheet
Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

aWS.Range("A22") = ]Sheet1'!$B$" &
aWS.Range("A20").Value
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default fill a cell with this..

it doesn't work.
...but the = is shure correct :)

"John Bundy" wrote:

try this
aWS.Range("A22") = ]Sheet1'!$B$" &
aWS.Range("A20").Value
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"pls123" wrote:

hi all i have to fill cell A20 with ]Sheet1'!$B$999
where 999 is the value of cell A20.
if u can describe the right syntax, that will help me a lot !! ty


Sub A22()
Dim aWB As Workbook
Dim aWS As Worksheet
Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

aWS.Range("A22") = ]Sheet1'!$B$" &
aWS.Range("A20").Value
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default fill a cell with this..

OOOO it works...
but the macro named A22 didn't work..dont'know why...
i changed the name and now its' ok !

"pls123" wrote:

it doesn't work.
..but the = is shure correct :)

"John Bundy" wrote:

try this
aWS.Range("A22") = ]Sheet1'!$B$" &
aWS.Range("A20").Value
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"pls123" wrote:

hi all i have to fill cell A20 with ]Sheet1'!$B$999
where 999 is the value of cell A20.
if u can describe the right syntax, that will help me a lot !! ty


Sub A22()
Dim aWB As Workbook
Dim aWS As Worksheet
Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

aWS.Range("A22") = ]Sheet1'!$B$" &
aWS.Range("A20").Value
End Sub

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
Auto Fill Cell Based on Data in a different cell JB Bates[_2_] Excel Discussion (Misc queries) 4 October 15th 09 04:17 PM
remove fill in text from a cell from an unpopulated fill-in cell Deb[_3_] Excel Worksheet Functions 1 September 22nd 09 03:28 PM
Code to copy cell borders and fill color from one cell to another Chuck M Excel Programming 4 January 10th 08 12:34 PM
Cell fill color. Row to match specific cell. CADinDallas Excel Programming 3 January 4th 06 01:00 PM
Auto-fill cell based on adjacent cell information.. sans Excel Worksheet Functions 1 October 17th 05 11:38 PM


All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"