Trying to get the solution...

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,284
Office Version
  1. 365
Platform
  1. Windows
Hi All Experts,

Can anyone solve the problem?

in cell a10, i have a value.

if cell a10 = "any value"
then
it should get reflect in Col B.

The starting point of Col B is started from - b13 to last value in col A. (i.e- if value end in col A at a16, then b13 to b16 is the range.)

Is this possible?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try this...
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For i = 13 To Range("A" & Rows.Count).End(xlUp).Row
    If Range("A" & i) <> Empty Then Range("B" & i).Value = Range("A" & i)
Next
End Sub
 
Upvote 0
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For i = 13 To Range("A" & Rows.Count).End(xlUp).Row
    If Range("A" & i) <> Empty Then Range("B" & i).Value = Range("A" & i)
Next
End Sub

But how i can understand the from A10 value is reading?
 
Upvote 0
Where do you want your value in A10 if your B column starts in 13? How it will reflect the value in B?Is it necessary that the rows are same? anyhow, try this
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For i = 10 To Range("A" & Rows.Count).End(xlUp).Row
    If Range("A" & i) <> Empty Then Range("B" & i+3).Value = Range("A" & i)
Next
End Sub
 
Upvote 0
Hey Villy,

sorry for distrubing you again.

i got all solution. Only one modification i require,

the o/p that is in col B came, seeee....

a10 contains value.

This value i got in the respective Col B starting from B13.

But i dont want all content of a10.
first 5 characters should get remove and then this value come in b13.

any way i using right function, but this gonaa not make any solution.

Can u pls prefer me the best?:eeek:
 
Upvote 0
Hey Villy,

But i dont want all content of a10.
first 5 characters should get remove and then this value come in b13.
Do you want to remove first 5 char of A10 only or for all starting from A10 please be specific..thanks
give you the solution in a moment
 
Upvote 0
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For i = 10 To Range("A" & Rows.Count).End(xlUp).Row
    Set Rng = Range("A" & i)
    If Rng <> Empty Then
        If i = 10 Then
            temp = Right(Rng, Len(Rng) - 5)
            Range("B" & i + 3).Value = temp
        Else
            Range("B" & i + 3).Value = Rng
        End If
    End If
Next
End Sub
This one should work
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,233
Members
452,898
Latest member
Capolavoro009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top